File tree Expand file tree Collapse file tree 6 files changed +46
-1
lines changed Expand file tree Collapse file tree 6 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Learning WEBPACK - MODULE BUNDLER
2
2
3
+ ## Table of Content
3
4
| Eg.No.| Execution Command| Comments|
4
5
| ------| -----------------| --------|
5
6
| 1| ``` webpack entry.js bundle.js ``` | Webpack will read entry.js file to build bundle.js|
19
20
| 12| ``` webpack ``` | Shows how to load raw file|
20
21
| 13| ``` webpack ``` | Shows how to configure jshint & JSCS loaders for JavaScript linting|
21
22
| 14| ``` webpack ``` | Shows how to load Handlebars templates file|
23
+ | 15| ``` webpack ``` | Shows how to load LESS loader|
Original file line number Diff line number Diff line change
1
+ require ( './styles.less' ) ;
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > Eg15: LESS loader</ title >
6
+ </ head >
7
+ < body >
8
+ < div id ="container ">
9
+ < h1 > Hello World</ h1 >
10
+ < h2 > Experiment with Webpack</ h2 >
11
+ </ div >
12
+
13
+ < script type ="text/javascript " src ="bundle.js "> </ script >
14
+ </ body >
15
+ </ html >
Original file line number Diff line number Diff line change
1
+ @h1-color : blue ;
2
+ @h2-color : green ;
3
+
4
+ #container {
5
+ h1 {
6
+ color : @h1-color ;
7
+ }
8
+
9
+ h2 {
10
+ color : @h2-color ;
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ entry : './entry.js' ,
3
+ output : {
4
+ filename : 'bundle.js'
5
+ } ,
6
+ module : {
7
+ loaders : [ {
8
+ test : / \. l e s s $ / ,
9
+ loader : 'style-loader!css-loader!less-loader'
10
+ } ]
11
+ }
12
+ } ;
Original file line number Diff line number Diff line change 22
22
},
23
23
"homepage" : " https://github.com/hegdeashwin/learning-webpack#readme" ,
24
24
"devDependencies" : {
25
- "css-loader" : " ^0.23.0" ,
25
+ "autoprefixer-loader" : " ^3.1.0" ,
26
+ "css-loader" : " ^0.23.1" ,
26
27
"csslint" : " ^0.10.0" ,
27
28
"csslint-loader" : " ^0.2.1" ,
28
29
"eslint" : " ^1.10.3" ,
29
30
"eslint-loader" : " ^1.1.1" ,
30
31
"handlebars" : " ^4.0.5" ,
31
32
"handlebars-loader" : " ^1.1.4" ,
33
+ "html-loader" : " ^0.4.0" ,
34
+ "image-webpack-loader" : " ^1.6.2" ,
32
35
"jscs" : " ^2.7.0" ,
33
36
"jscs-loader" : " ^0.2.0" ,
34
37
"jshint" : " ^2.8.0" ,
You can’t perform that action at this time.
0 commit comments