##Notes ###Link
###First Demo
-
use atom as the editor for auto-complete functionality
-
init
package.json
npm init- install webpack
sudo npm i webpack --save-dev-
create
index.js, and usenpm startgeneratebundle.jsa single file include inindex.html -
check with our brower, execute
bundle.js, rendering the html
google-chrome-stable ./index.html###Second Demo
-
create
bear.js -
modify
index.jsto require the modulebear.js -
check with our brower, execute
bundle.js, rendering the html
google-chrome-stable ./index.html###Third Demo(Server Mode)
- install webpack other dependencies
sudo npm i webpack-dev-server --save-dev-
browse
http://localhost:8080/webpack-dev-server/ -
install jquery
sudo npm i jquery --save- async loading
index.js
require(['./bear.js'], function(bear) {
document.body.appendChild(bear[0]);
})- install css loader
sudo npm i css-loader --save-dev- install style loader
sudo npm i style-loader --save-dev- modify
bear.js, ask the css loader to parse css first
require('css!./bear.css')