提问人:Wasif Hussain 提问时间:11/16/2023 最后编辑:VLAZWasif Hussain 更新时间:11/16/2023 访问量:17
构建后无法将 react 前端连接到后端 [关闭]
Cant connect react frontend to backend after build [closed]
问:
我的 vite.config.js ,我已经使用 chatgpt 添加了构建部分,但我认为它不起作用
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3000,
// Get rid of the CORS error
proxy: {
"/api": {
target: "https://threads-backend-kzv5.onrender.com",
changeOrigin: true,
secure: true,
},
},
},
build: {
target: "esnext", // or "esnext" if your environment supports it
polyfillDynamicImport: false, // disable dynamic import polyfill
},
});
答: 暂无答案
评论