Skip to content

Commit bb8cbe9

Browse files
committedJan 23, 2024
fix: enable optimizing dependencies in build mode
1 parent 20ef600 commit bb8cbe9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎packages/jsx-explorer/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ function main() {
5757
model: monaco.editor.createModel(
5858
decodeURIComponent(window.location.hash.slice(1)) ||
5959
persistedState.src ||
60-
'const App = () => <div>Hello World</div>',
60+
`import { defineComponent } from 'vue'
61+
62+
const App = defineComponent((props) => <div>Hello World</div>)`,
6163
'typescript',
6264
monaco.Uri.parse('file:///app.tsx')
6365
),

‎packages/jsx-explorer/vite.config.ts

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import VueJSX from '@vitejs/plugin-vue-jsx';
44
import MonacoEditorPlugin from 'vite-plugin-monaco-editor';
55

66
export default defineConfig({
7+
build: {
8+
commonjsOptions: {
9+
include: [],
10+
},
11+
},
712
resolve: {
813
alias: {
914
'@vue/babel-plugin-jsx': '@vue/babel-plugin-jsx/src/index.ts',
@@ -21,4 +26,7 @@ export default defineConfig({
2126
},
2227
}),
2328
],
29+
optimizeDeps: {
30+
disabled: false,
31+
},
2432
});

0 commit comments

Comments
 (0)
Please sign in to comment.