1.设置镜像源
##设置 npm镜像源
npm config set registry https://registry.npm.taobao.org
2.全局安装webpack
npm install -g webpack
3.自定义目录安装webpack并复制node_modules到项目目录
##当前目前执行
npm install webpack --save-dev
##生成node_modules文件复制到项目
4.安装其他插件
npm install html-webpack-plugin
npm install mini-css-extract-plugin
npm install -g yarn
5.配置webpack.config.js
可省略
6.打包
yarn run build
网友评论