clash-verge-rev/vite.config.mts
renovate[bot] b707dd264e
build(vite)!: migrate to Vite 8, switch to Oxc-based @vitejs/plugin-react, and clean up legacy compatibility config (#6492)
* chore(deps): update npm dependencies to v8

* build(vite)!: migrate to Vite 8, switch to Oxc-based @vitejs/plugin-react, and clean up legacy compatibility config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
2026-03-13 06:42:09 +00:00

40 lines
946 B
TypeScript

import path from "node:path";
import legacy from "@vitejs/plugin-legacy";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
export default defineConfig({
root: "src",
server: { port: 3000 },
plugins: [
svgr(),
react(),
legacy({
modernTargets: ["edge>=109", "safari>=14"],
renderLegacyChunks: false,
modernPolyfills: ["es.object.has-own", "web.structured-clone"],
additionalModernPolyfills: [
path.resolve("./src/polyfills/matchMedia.js"),
path.resolve("./src/polyfills/WeakRef.js"),
path.resolve("./src/polyfills/RegExp.js"),
],
}),
],
build: {
outDir: "../dist",
emptyOutDir: true,
chunkSizeWarningLimit: 4000,
},
resolve: {
alias: {
"@": path.resolve("./src"),
"@root": path.resolve("."),
},
},
define: {
OS_PLATFORM: `"${process.platform}"`,
},
});