我有一个vue-cli 2尝试升级到的现有应用vue-cli-3。添加了唯一的依赖关系后,我src/直接进入了新创建的vue-cli-3应用程序并启动了。woo!
[PROD|DEV|TEST].env.js现在我们该如何使用vue.config.js?
我收到以下错误,因为我第一次尝试创建a vue.config.js是简单地将其重命名config/index.js为be /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.
Run Code Online (Sandbox Code Playgroud)
我不明白现在如何管理环境。
谢谢你的时间!
也许你应该改用devServer。我想build现在有另一个名字了。
例如:
module.exports = {
devServer: {
// your settings
}
}
Run Code Online (Sandbox Code Playgroud)
例如:
module.exports = {
devServer: {
proxy: {
'/api': {
target: '<url>',
ws: true,
changeOrigin: true
},
'/foo': {
target: '<other_url>'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
参考:vue-cli
| 归档时间: |
|
| 查看次数: |
2455 次 |
| 最近记录: |