mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-12-24 11:25:54 +08:00
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import path from "path";
|
|
import svgr from "vite-plugin-svgr";
|
|
import react from "@vitejs/plugin-react";
|
|
import legacy from "@vitejs/plugin-legacy";
|
|
import monacoEditor from "vite-plugin-monaco-editor";
|
|
|
|
export default defineConfig({
|
|
root: "src",
|
|
server: { port: 3000 },
|
|
plugins: [
|
|
svgr(),
|
|
react(),
|
|
legacy({
|
|
renderLegacyChunks: false,
|
|
modernTargets: ["edge>=109", "safari>=13"],
|
|
modernPolyfills: true,
|
|
additionalModernPolyfills: [
|
|
"core-js/modules/es.object.has-own.js",
|
|
"core-js/modules/web.structured-clone.js",
|
|
path.resolve("./src/polyfills/matchMedia.js"),
|
|
path.resolve("./src/polyfills/WeakRef.js"),
|
|
path.resolve("./src/polyfills/RegExp.js"),
|
|
],
|
|
}),
|
|
monacoEditor({
|
|
languageWorkers: ["editorWorkerService", "typescript", "css"],
|
|
customWorkers: [
|
|
{
|
|
label: "yaml",
|
|
entry: "monaco-yaml/yaml.worker",
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
build: {
|
|
outDir: "../dist",
|
|
emptyOutDir: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve("./src"),
|
|
"@root": path.resolve("."),
|
|
},
|
|
},
|
|
define: {
|
|
OS_PLATFORM: `"${process.platform}"`,
|
|
},
|
|
});
|