Webpack2 学习笔记(七): webpack-dev-server 使用简介

Posted by zhulinpinyu on February 5, 2017

https://www.udemy.com/webpack-2-the-complete-developers-guide/

17-02-03-webpack-dev-server.png

安装依赖包:

yarn add webpack-dev-server@2.2.0 --dev

文件package.json

...
"scripts": {
  "clean": "rimraf dist",
  "build": "yarn run clean && webpack",
  "serve": "webpack-dev-server"
},

...

运行:

yarn run serve

访问: http://localhost:8080/ 即可

Source code