【问题标题】:The vite profile does not take effect at allvite配置文件根本不生效
【发布时间】:2021-11-08 04:35:21
【问题描述】:
vite.config.js
export default {
    root:'./',
    server: {
        host: '0.0.0.0',
        port: 8080,
        open: true,
        proxy: {
            '/dev': 'http://localhost:6806'
        }
    }
}

我是新手。 npm run dev之后,服务器还在3000上运行,开发者工具上的请求是: POST http://localhost:3000/dev/api/query/sql 404 (Not Found) 真正的结果应该是localhost:6806吧?

//package.json
...
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },
...

两个文件都在根目录下

【问题讨论】:

    标签: vue.js vite


    【解决方案1】:

    我的 Vite 版本是 1.x

    但是我阅读的文档是针对 Vite 2.0 的。

    只需升级 Vite。

    【讨论】:

    • 你可以接受你自己的答案:)
    猜你喜欢
    • 2022-08-02
    • 2021-02-18
    • 2011-10-01
    • 2021-05-23
    • 1970-01-01
    • 2018-08-08
    • 1970-01-01
    • 2018-03-26
    相关资源
    最近更新 更多