File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Expand file tree Collapse file tree 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[] {
165165 }
166166 } ,
167167 async transform ( code , id , options ) {
168- const ssr = typeof options === 'boolean' ? options : options ?. ssr === true
168+ const ssr = options ?. ssr === true
169169 // File extension could be mocked/overridden in querystring.
170170 const [ filepath , querystring = '' ] = id . split ( '?' )
171171 const [ extension = '' ] =
@@ -379,7 +379,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
379379 /*
380380 resolveId(id: string) {
381381 return id === runtimeId ? id : null
382- },
382+ },
383383 load(id: string) {
384384 if (id === runtimeId) {
385385 const runtimePath = resolve.sync(runtimeId, {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ function vueJsxPlugin(options: Options = {}): Plugin {
7474 } ,
7575
7676 async transform ( code , id , opt ) {
77- const ssr = typeof opt === 'boolean' ? opt : ( opt && opt . ssr ) === true
77+ const ssr = opt ? .ssr === true
7878 const {
7979 include,
8080 exclude,
Original file line number Diff line number Diff line change @@ -107,14 +107,6 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
107107 devToolsEnabled : process . env . NODE_ENV !== 'production'
108108 }
109109
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-
118110 return {
119111 name : 'vite:vue' ,
120112
@@ -169,7 +161,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
169161 } ,
170162
171163 load ( id , opt ) {
172- const ssr = isSSR ( opt )
164+ const ssr = opt ?. ssr === true
173165 if ( id === EXPORT_HELPER_ID ) {
174166 return helperCode
175167 }
@@ -202,7 +194,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
202194 } ,
203195
204196 transform ( code , id , opt ) {
205- const ssr = isSSR ( opt )
197+ const ssr = opt ?. ssr === true
206198 const { filename, query } = parseVueRequest ( id )
207199 if ( query . raw ) {
208200 return
You can’t perform that action at this time.
0 commit comments