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”,應(yīng)改為“public”。