2023-06-22 12:14:02 +08:00
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
2024-01-24 02:42:21 +08:00
|
|
|
import VueJSX from '@vitejs/plugin-vue-jsx';
|
|
|
|
import MonacoEditorPlugin from 'vite-plugin-monaco-editor';
|
2023-06-22 12:14:02 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
2024-01-24 03:11:39 +08:00
|
|
|
build: {
|
|
|
|
commonjsOptions: {
|
|
|
|
include: [],
|
|
|
|
},
|
|
|
|
},
|
2023-06-22 19:18:56 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@vue/babel-plugin-jsx': '@vue/babel-plugin-jsx/src/index.ts',
|
|
|
|
},
|
|
|
|
},
|
2023-06-22 12:14:02 +08:00
|
|
|
plugins: [
|
2024-01-24 02:42:21 +08:00
|
|
|
VueJSX(),
|
|
|
|
// @ts-expect-error
|
|
|
|
(MonacoEditorPlugin.default as typeof MonacoEditorPlugin)({
|
|
|
|
languageWorkers: ['editorWorkerService', 'typescript'],
|
|
|
|
}),
|
2023-06-22 12:14:02 +08:00
|
|
|
nodePolyfills({
|
|
|
|
globals: {
|
|
|
|
process: true,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2024-01-24 03:11:39 +08:00
|
|
|
optimizeDeps: {
|
|
|
|
disabled: false,
|
|
|
|
},
|
2023-06-22 12:14:02 +08:00
|
|
|
});
|