File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -48,16 +48,21 @@ function vueJsxPlugin(options = {}) {
48
48
name : 'vite:vue-jsx' ,
49
49
50
50
config ( config ) {
51
+ const optionsApi = config . define
52
+ ? config . define . __VUE_OPTIONS_API__
53
+ : undefined
54
+ const devTools = config . define
55
+ ? config . define . __VUE_PROD_DEVTOOLS__
56
+ : undefined
51
57
return {
52
58
// only apply esbuild to ts files
53
59
// since we are handling jsx and tsx now
54
60
esbuild : {
55
61
include : / \. t s $ /
56
62
} ,
57
63
define : {
58
- __VUE_OPTIONS_API__ : true ,
59
- __VUE_PROD_DEVTOOLS__ : false ,
60
- ...config . define
64
+ __VUE_OPTIONS_API__ : optionsApi != null ? optionsApi : true ,
65
+ __VUE_PROD_DEVTOOLS__ : devTools != null ? devTools : false
61
66
}
62
67
}
63
68
} ,
Original file line number Diff line number Diff line change @@ -130,8 +130,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
130
130
config ( ) {
131
131
return {
132
132
define : {
133
- __VUE_OPTIONS_API__ : true ,
134
- __VUE_PROD_DEVTOOLS__ : false
133
+ __VUE_OPTIONS_API__ : config . define ?. __VUE_OPTIONS_API__ ?? true ,
134
+ __VUE_PROD_DEVTOOLS__ : config . define ?. __VUE_PROD_DEVTOOLS__ ?? false
135
135
} ,
136
136
ssr : {
137
137
external : [ 'vue' , '@vue/server-renderer' ]
You can’t perform that action at this time.
0 commit comments