Skip to content

Commit

Permalink
chore(plugin-vue): backwards compat for ssr option
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 19, 2021
1 parent 1506285 commit b4af35e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export interface Options {
script?: Partial<SFCScriptCompileOptions>
template?: Partial<SFCTemplateCompileOptions>
style?: Partial<SFCStyleCompileOptions>
/**
* @deprecated the plugin now auto-detects whether it's being invoked for ssr.
*/
ssr?: boolean
}

export interface ResolvedOptions extends Options {
Expand Down Expand Up @@ -103,7 +107,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
}
},

load(id, ssr = false) {
load(id, ssr = !!options.ssr) {
const { filename, query } = parseVueRequest(id)
// select corresponding block for subpart virtual modules
if (query.vue) {
Expand Down Expand Up @@ -131,7 +135,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
}
},

transform(code, id, ssr = false) {
transform(code, id, ssr = !!options.ssr) {
const { filename, query } = parseVueRequest(id)
if (!query.vue && !filter(filename)) {
return
Expand Down

0 comments on commit b4af35e

Please sign in to comment.