fix: enable optimizing dependencies in build mode

This commit is contained in:
三咲智子 Kevin Deng 2024-01-24 03:11:39 +08:00
parent 20ef600064
commit bb8cbe957e
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
2 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,9 @@ function main() {
model: monaco.editor.createModel(
decodeURIComponent(window.location.hash.slice(1)) ||
persistedState.src ||
'const App = () => <div>Hello World</div>',
`import { defineComponent } from 'vue'
const App = defineComponent((props) => <div>Hello World</div>)`,
'typescript',
monaco.Uri.parse('file:///app.tsx')
),

View File

@ -4,6 +4,11 @@ import VueJSX from '@vitejs/plugin-vue-jsx';
import MonacoEditorPlugin from 'vite-plugin-monaco-editor';
export default defineConfig({
build: {
commonjsOptions: {
include: [],
},
},
resolve: {
alias: {
'@vue/babel-plugin-jsx': '@vue/babel-plugin-jsx/src/index.ts',
@ -21,4 +26,7 @@ export default defineConfig({
},
}),
],
optimizeDeps: {
disabled: false,
},
});