代码拉取完成,页面将自动刷新
import { defineConfig } from "vite";
import legacy from "@vitejs/plugin-legacy";
import vitePluginImp from "vite-plugin-imp";
import reactRefresh from "@vitejs/plugin-react-refresh";
import { minifyHtml } from "vite-plugin-html";
const path = require("path");
// https://vitejs.dev/config/
export default defineConfig({
base: "/",
define: {
// isProdEnv: NODE_ENV === "production",
apiGlobalPrefix: JSON.stringify(""),
"process.env": "{}",
global: {},
},
plugins: [
legacy({
targets: ["defaults", "not IE 11"],
}),
vitePluginImp({
libList: [
// { libName: "antd", style: name => `antd/es/${name}/style/index.css` },
],
}),
reactRefresh(),
minifyHtml(),
],
publicDir: "public",
resolve: {
alias: {
"~": path.resolve(__dirname, "./"),
"@": path.resolve(__dirname, "./src"),
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
modifyVars: {
// "white": "#3C3F41",
// "primary-color": "#3C3F41",
},
}
},
modules: {
localsConvention: "camelCaseOnly"
}
},
clearScreen: true,
server: {
host: "0.0.0.0",
port: 8000,
proxy: {
"/fast_api": {
target: "http://127.0.0.1:18081",
changeOrigin: true,
// rewrite: path => path,
},
"/api": {
target: "http://127.0.0.1:18081",
changeOrigin: true,
// rewrite: path => path,
},
},
force: true,
},
build: {
target: "modules",
polyfillDynamicImport: false,
outDir: "dist",
assetsDir: "assets",
assetsInlineLimit: 4096,
cssCodeSplit: true,
rollupOptions: {},
commonjsOptions: {}
},
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。