Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Commit 41917f8

Browse files
committed
Merge pull request #13 from scottmas/master
Simple starter demo
2 parents e27c97d + 54dfc07 commit 41917f8

File tree

8 files changed

+89
-0
lines changed

8 files changed

+89
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ pids
1111
logs
1212
results
1313

14+
.idea
15+
1416
npm-debug.log
1517
node_modules
18+
bower_components

demo/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
To get the demo working, first ensure you have webpack and bower globally installed. In your command line type:
2+
3+
npm install webpack -g;
4+
npm install bower -g;
5+
6+
(Webpack may have some issues installing on Windows. If it doesn't work, simply try it again and it usually works the second time.)
7+
8+
Next, in your CLI download your node and bower dependencies (e.g. angular and angular-webpack-plugin).
9+
10+
npm install;
11+
bower install;
12+
13+
(If Windows users again experience issues with npm install, try it again and it should work the second time)
14+
15+
You're almost set! All the config is set in webpack.config.js, so we just need to run the simple webpack CLI command:
16+
17+
webpack;
18+
19+
Now open index.html in your browser (e.g. get it served by a local server or even open it as a file) and you should see everything loaded.

demo/bower.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "webpack-angular",
3+
"version": "0.0.0",
4+
"authors": [
5+
"Scott Ashton <scottmortonashton@gmail.com>"
6+
],
7+
"license": "MIT",
8+
"ignore": [
9+
"**/.*",
10+
"node_modules",
11+
"bower_components",
12+
"test",
13+
"tests"
14+
],
15+
"dependencies": {
16+
"angular": "~1.2.24"
17+
}
18+
}

demo/dependency.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var dependency = angular.module('dependency', []);
2+
3+
dependency.run(function($document){
4+
$document[0].write('Hello from dependency. ')
5+
});

demo/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<meta charset="utf-8">
4+
</head>
5+
<body ng-app="myApp">
6+
<script type="text/javascript" src="generated_bundle.js" charset="utf-8"></script>
7+
</body>
8+
</html>

demo/myApp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var myApp = angular.module('myApp', ['dependency']);
2+
3+
myApp.run(function($document){
4+
$document[0].write('Hello from myApp. ');
5+
});

demo/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "webpack-angular",
3+
"version": "0.0.0",
4+
"description": "",
5+
"main": "app.js",
6+
"dependencies": {
7+
"angular-webpack-plugin": "^0.0.2",
8+
"exports-loader": "^0.6.2",
9+
"webpack": "^1.4.0-beta4"
10+
},
11+
"devDependencies": {},
12+
"scripts": {
13+
"test": "echo \"Error: no test specified\" && exit 1"
14+
},
15+
"author": "Scott M Ashton <ScottMortonAshton@gmail.com> (https://github.com/scottmas)",
16+
"license": "ISC"
17+
}

demo/webpack.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var AngularPlugin = require('angular-webpack-plugin');
2+
var path = require('path');
3+
module.exports = {
4+
entry: "myApp",
5+
output: {
6+
path: __dirname,
7+
filename: "generated_bundle.js"
8+
},
9+
resolve: {
10+
root: [ process.cwd(), path.resolve('bower_components') ]
11+
},
12+
plugins: [new AngularPlugin()]
13+
14+
};

0 commit comments

Comments
 (0)