npm install webpack -g
webpack ./app.js bundle.js
Open index.html in the browser
add the file of webpack.config.js as following
module.exports = {
entry: "./app.js",
output: {
filename: "bundle.js"
}
}
webpack --watch
To show the resule as above command, we can write code as following
module.exports = {
entry: "./app.js",
output: {
filename: "bundle.js"
},
watch: true
}
npm install webpack-dev-server -g
webpack-dev-server
- Open URL
http://localhost:8080/webpack-dev-server/
],http://localhost:8080/
orhttp://localhost:8080/index.html
orhttp://localhost:8080/webpack-dev-server/index.html
in the browser.
npm install babel-core babel-loader babel-preset-es2015 jshint jshint-loader node-libs-browser --save-dev
npm install strip-loader --save-dev | npm install http-server -g
webpack-dev-server -d
As above command, You can use the key of debugger to debug.