Files
frost-navigation/vite.config.js

51 lines
1.0 KiB
JavaScript
Raw Normal View History

2024-08-26 14:07:57 +08:00
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
2024-08-26 14:07:57 +08:00
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
function getPath(url = '') {
return fileURLToPath(new URL(url, import.meta.url));
}
export default defineConfig({
base: './',
build: {
assetsInlineLimit: 0,
},
esbuild: {
supported: {
bigint: true,
},
},
2024-08-26 14:07:57 +08:00
envPrefix: 'V_ENV_',
2025-10-26 22:23:20 +08:00
optimizeDeps: {
include: [
// 预构建 Monaco Editor Worker
'monaco-editor/esm/vs/editor/editor.worker',
'monaco-editor/esm/vs/language/json/json.worker',
],
},
2024-08-26 14:07:57 +08:00
plugins: [
legacy({
polyfills: false,
renderLegacyChunks: true,
renderModernChunks: true,
targets: ['defaults', 'not IE 11'],
}),
2024-08-26 14:07:57 +08:00
vue(),
vueJsx(),
],
resolve: {
alias: {
'@': getPath('./src'),
'@package-json': getPath('./package.json'),
},
},
server: {
allowedHosts: true,
2024-08-26 14:07:57 +08:00
port: 9000,
},
});