Webpack实时刷新代码
1.安装插件
npm install webpack-dev-server@2.9.3 --save-dev
2.webpackconfig.js新增
devServer:{
contentBase:'./dist', //为哪一个文件夹提供本地服务,默认根文件夹,这里填写./dist
inline:true //页面实时刷新
}
3.终端运行
.\node_modules\.bin\webpack-dev-server.cmd
4.运行
npm run build