cl3没有vue.config.js,在根目录下新建一个vue.config.js。 然后加上下面代码
module.exports = {
configureWebpack: {
// other webpack options to merge in ...
},
// devServer Options don't belong into `configureWebpack`
devServer: {
public: '0.0.0.0:8080',
hot: true,
disableHostCheck: true,
}
};
注意:
devServer: {
host: '0.0.0.0:8080',
hot: true,
disableHostCheck: true,
devServer:
{
host: '0.0.0.0:8080',
hot: true,
disableHostCheck: true,
默认为 “host”,应改为“public”。