我有一个现有的vue-cli 2应用程序,我正在尝试升级到vue-cli-3。在添加了唯一的依赖项之后,我将src/直接放到新创建的vue-cli-3应用程序中并启动。哇哦!
既然我们使用了[PROD|DEV|TEST].env.js,我如何管理vue.config.js?
我得到了以下错误,因为创建vue.config.js的第一次尝试只是将config/index.js重命名为/vue.config.js并保留现有的/config/[PROD|DEV|TEST].env.js,但我得到了以下错误:
ERROR Invalid options in vue.config.js: "build" is not allowed. "dev"
is not allowed error Command failed with exit code 1.我不明白现在是如何管理环境的。
耽误您时间,实在对不起!
发布于 2018-06-23 03:05:50
也许你应该用devServer代替。对于build,我想现在有另外一个名字了。
例如:
module.exports = {
devServer: {
// your settings
}
}例如:
module.exports = {
devServer: {
proxy: {
'/api': {
target: '<url>',
ws: true,
changeOrigin: true
},
'/foo': {
target: '<other_url>'
}
}
}
}参考资料:武克利
https://stackoverflow.com/questions/49806869
复制相似问题