File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ function vueJsxPlugin(options = {}) {
80
80
}
81
81
} ,
82
82
83
- transform ( code , id , ssr ) {
83
+ transform ( code , id , opt ) {
84
+ const ssr = typeof opt === 'boolean' ? opt : ( opt && opt . ssr ) === true
84
85
const {
85
86
include,
86
87
exclude,
Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
104
104
sourceMap : true
105
105
}
106
106
107
+ // Temporal handling for 2.7 breaking change
108
+ const isSSR = ( opt : { ssr ?: boolean } | boolean | undefined ) =>
109
+ opt === undefined ? ! ! options . ssr :
110
+ ( typeof opt === 'boolean' ? opt : opt ?. ssr === true )
111
+
107
112
return {
108
113
name : 'vite:vue' ,
109
114
@@ -150,7 +155,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
150
155
}
151
156
} ,
152
157
153
- load ( id , ssr = ! ! options . ssr ) {
158
+ load ( id , opt ) {
159
+ const ssr = isSSR ( opt )
154
160
if ( id === EXPORT_HELPER_ID ) {
155
161
return helperCode
156
162
}
@@ -182,7 +188,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
182
188
}
183
189
} ,
184
190
185
- transform ( code , id , ssr = ! ! options . ssr ) {
191
+ transform ( code , id , opt ) {
192
+ const ssr = isSSR ( opt )
186
193
const { filename, query } = parseVueRequest ( id )
187
194
if ( query . raw ) {
188
195
return
You can’t perform that action at this time.
0 commit comments