修改 webpack 配置
在 webpack.config.js
中 entry
、 plugins
、mode
同级新增节点 devServer
,基本的配置如下:
// ...
module.exports = {
// ...
devServer: {
port: 9090,
host: 'localhost',
hot: true
},
// ...
}
该配置表示通过url:http://localhost:909
来访问应用。