File tree Expand file tree Collapse file tree
getting-started-with-webpack Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Getting Started with webpack
2+
3+ > [ https://www.youtube.com/watch?v=TaWKUpahFZM ] ( https://www.youtube.com/watch?v=TaWKUpahFZM )
4+
5+ Install [ io.js] ( https://iojs.org/en/index.html ) .
6+
7+ Within this folder run the terminal command ` npm install ` to install the
8+ ` dependencies ` and ` devDependencies ` .
9+
10+ Then run ` npm start ` to build as you edit files while viewing ` http://localhost:8080 `
Original file line number Diff line number Diff line change 1+ body {
2+ background-color : green;
3+ }
Original file line number Diff line number Diff line change 1+ @import 'base.css' ;
2+
3+ div {
4+ color : red;
5+ }
Original file line number Diff line number Diff line change 1+ var $ = require ( 'jquery' )
2+
3+ require ( './bear.css' )
4+
5+ module . exports = $ ( '<div/>' ) . html ( 'grizzly growl!' )
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < title > </ title >
6+ </ head >
7+ < body >
8+ < script src ="bundle.js " charset ="utf-8 "> </ script >
9+ </ body >
10+ </ html >
Original file line number Diff line number Diff line change 1+ require ( [ './bear.js' ] , function ( bear ) {
2+ document . body . appendChild ( bear [ 0 ] )
3+ } )
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " getting-started-with-webpack" ,
3+ "version" : " 0.1.0" ,
4+ "main" : " index.js" ,
5+ "scripts" : {
6+ "start" : " webpack-dev-server ./index.js"
7+ },
8+ "author" : " Kyle Robinson Young <kyle@dontkry.com> (http://dontkry.com)" ,
9+ "license" : " MIT" ,
10+ "devDependencies" : {
11+ "css-loader" : " ^0.15.1" ,
12+ "style-loader" : " ^0.12.3" ,
13+ "webpack" : " ^1.10.1" ,
14+ "webpack-dev-server" : " ^1.10.1"
15+ },
16+ "dependencies" : {
17+ "css-loader" : " ~0.15.1" ,
18+ "jquery" : " ^2.1.4" ,
19+ "node-libs-browser" : " ~0.5.2" ,
20+ "style-loader" : " ~0.12.3" ,
21+ "webpack" : " ~1.10.1" ,
22+ "webpack-dev-server" : " ~1.10.1"
23+ },
24+ "description" : " "
25+ }
Original file line number Diff line number Diff line change 1+ module . exports = {
2+ entry : './index.js' ,
3+ output : {
4+ path : __dirname ,
5+ filename : 'bundle.js'
6+ } ,
7+ module : {
8+ loaders : [
9+ { test : / \. c s s $ / , loader : 'style!css!' }
10+ ]
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments