File tree 3 files changed +5
-13
lines changed
3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
165
165
}
166
166
} ,
167
167
async transform ( code , id , options ) {
168
- const ssr = typeof options === 'boolean' ? options : options ?. ssr === true
168
+ const ssr = options ?. ssr === true
169
169
// File extension could be mocked/overridden in querystring.
170
170
const [ filepath , querystring = '' ] = id . split ( '?' )
171
171
const [ extension = '' ] =
@@ -379,7 +379,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
379
379
/*
380
380
resolveId(id: string) {
381
381
return id === runtimeId ? id : null
382
- },
382
+ },
383
383
load(id: string) {
384
384
if (id === runtimeId) {
385
385
const runtimePath = resolve.sync(runtimeId, {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ function vueJsxPlugin(options: Options = {}): Plugin {
74
74
} ,
75
75
76
76
async transform ( code , id , opt ) {
77
- const ssr = typeof opt === 'boolean' ? opt : ( opt && opt . ssr ) === true
77
+ const ssr = opt ? .ssr === true
78
78
const {
79
79
include,
80
80
exclude,
Original file line number Diff line number Diff line change @@ -107,14 +107,6 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
107
107
devToolsEnabled : process . env . NODE_ENV !== 'production'
108
108
}
109
109
110
- // Temporal handling for 2.7 breaking change
111
- const isSSR = ( opt : { ssr ?: boolean } | boolean | undefined ) =>
112
- opt === undefined
113
- ? false
114
- : typeof opt === 'boolean'
115
- ? opt
116
- : opt ?. ssr === true
117
-
118
110
return {
119
111
name : 'vite:vue' ,
120
112
@@ -169,7 +161,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
169
161
} ,
170
162
171
163
load ( id , opt ) {
172
- const ssr = isSSR ( opt )
164
+ const ssr = opt ?. ssr === true
173
165
if ( id === EXPORT_HELPER_ID ) {
174
166
return helperCode
175
167
}
@@ -202,7 +194,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
202
194
} ,
203
195
204
196
transform ( code , id , opt ) {
205
- const ssr = isSSR ( opt )
197
+ const ssr = opt ?. ssr === true
206
198
const { filename, query } = parseVueRequest ( id )
207
199
if ( query . raw ) {
208
200
return
You can’t perform that action at this time.
0 commit comments