Skip to content

Commit

Permalink
refactor: remove hooks ssr param support (#8491)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
  • Loading branch information
sapphi-red and bluwy committed Jun 8, 2022
1 parent 33b0ea6 commit 83f3dce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-vue-jsx/src/index.ts
Expand Up @@ -74,7 +74,7 @@ function vueJsxPlugin(options: Options = {}): Plugin {
},

async transform(code, id, opt) {
const ssr = typeof opt === 'boolean' ? opt : (opt && opt.ssr) === true
const ssr = opt?.ssr === true
const {
include,
exclude,
Expand Down
12 changes: 2 additions & 10 deletions packages/plugin-vue/src/index.ts
Expand Up @@ -107,14 +107,6 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
devToolsEnabled: process.env.NODE_ENV !== 'production'
}

// Temporal handling for 2.7 breaking change
const isSSR = (opt: { ssr?: boolean } | boolean | undefined) =>
opt === undefined
? false
: typeof opt === 'boolean'
? opt
: opt?.ssr === true

return {
name: 'vite:vue',

Expand Down Expand Up @@ -169,7 +161,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
},

load(id, opt) {
const ssr = isSSR(opt)
const ssr = opt?.ssr === true
if (id === EXPORT_HELPER_ID) {
return helperCode
}
Expand Down Expand Up @@ -202,7 +194,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
},

transform(code, id, opt) {
const ssr = isSSR(opt)
const ssr = opt?.ssr === true
const { filename, query } = parseVueRequest(id)
if (query.raw) {
return
Expand Down

0 comments on commit 83f3dce

Please sign in to comment.