长风秋雁
看看webpack官网, 比installation章节, 面介绍安装webpack.首先需要安装全局webpacknpm install webpack -g才确使用webpack命令, 前项目面安装webpack, 官推荐做npm install webpack --save-dev自webpack.config.js面便引用webpack// webpack.config.jsvar path = require('path');var webpack = require('webpack');使用些plugin候比较便new webpack.optimize.CommonsChunkPlugin('common.js')