This repository was archived by the owner on Dec 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +89
-0
lines changed
Expand file tree Collapse file tree 8 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 1111logs
1212results
1313
14+ .idea
15+
1416npm-debug.log
1517node_modules
18+ bower_components
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ var dependency = angular . module ( 'dependency' , [ ] ) ;
2+
3+ dependency . run ( function ( $document ) {
4+ $document [ 0 ] . write ( 'Hello from dependency. ' )
5+ } ) ;
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1+ var myApp = angular . module ( 'myApp' , [ 'dependency' ] ) ;
2+
3+ myApp . run ( function ( $document ) {
4+ $document [ 0 ] . write ( 'Hello from myApp. ' ) ;
5+ } ) ;
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ } ;
You can’t perform that action at this time.
0 commit comments