安装
- webpack
- webpack-dev-server
- webpack-cli
命令行
webpack //building for development
webpack -p //building for production
webpack --watch //building for continuous incremental building
webpack -d //including source map
webpack --colors //making building output pretty
重要概念
- entry
- output
- loader
webpack本身只理解js,loader可以将所有文件转换为webpack能够处理的模块 - 插件
loaders
-
babel-loader
: jsx/es6 -> normal js -
css-loader
: allows js to include css
References
阮兄webpack教程:https://github.com/ruanyf/webpack-demos#demo01-entry-file-source
网友评论