梗概:
使用方法:
- 在npm脚本上添加: “start”:“webpack serve —open”
实例
devServer: {
proxy: { // proxy URLs to backend development server
'/api': ' http://localhost:3000 '
},
static: path. join (__dirname, 'public'), // boolean | string | array | object, static file location
compress: true, // enable gzip compression
historyApiFallback: true, // true for index. html upon 404, object for multiple paths
hot: true, // hot module replacement. Depends on HotModuleReplacementPlugin
https: false, // true for self-signed, object for cert authority
// ...
},