mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-14 21:20:48 +08:00
837752a768
* chore(deps): update npm dependencies * fix(monaco): support editor 0.56 worker exports --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
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('.'),
|
|
'monaco-editor/esm/vs/editor/editor.worker.js':
|
|
'monaco-editor/editor/editor.worker',
|
|
},
|
|
},
|
|
define: {
|
|
OS_PLATFORM: `"${process.platform}"`,
|
|
},
|
|
})
|