ValidationError: Invalid options object. Dev Server has been initialized using an options object tha
ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.- options has an unknown property 'disableHostCheck'. These properti
ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property 'disableHostCheck'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
把vue.config.js 中的 config.devServer.disableHostCheck(true)注释掉
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = {
chainWebpack: config => {
把config.devServer.disableHostCheck(true)注释掉就可以运行了
config.devServer.disableHostCheck(true)
},
transpileDependencies: true,
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
path.join(__dirname, './src/assets/styles/variables.less'),
path.join(__dirname, './src/assets/styles/mixins.less')
]
}
}
}
更多推荐
所有评论(0)