Skip to content

Commit 83f3dce

Browse files
sapphi-redbluwy
andauthored
refactor: remove hooks ssr param support (#8491)
Co-authored-by: Bjorn Lu <[email protected]>
1 parent 33b0ea6 commit 83f3dce

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

packages/plugin-vue-jsx/src/index.ts

+1-1
Original file line numberDiff line numberDiff 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,

packages/plugin-vue/src/index.ts

+2-10
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)