webpack notes

# setup and install dependency js libs

npm init

npm install webpack --save-dev      # This should be optional

npm install jquery --save

# add js file

touch main.js

touch index.html

webpack main.js ./bundle.js

touch webpack.config.js

rm ./bundle.js # no need this file, because it is configured from webpack.config.js

webpack # just run this command

## run webpack with a watch option

webpack -w

# babel loader

npm install babel-loader babel-core --save-dev

你可能感兴趣的:(webpack notes)