Skip to content

Commit b4af35e

Browse files
committed
chore(plugin-vue): backwards compat for ssr option
1 parent 1506285 commit b4af35e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: packages/plugin-vue/src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export interface Options {
4343
script?: Partial<SFCScriptCompileOptions>
4444
template?: Partial<SFCTemplateCompileOptions>
4545
style?: Partial<SFCStyleCompileOptions>
46+
/**
47+
* @deprecated the plugin now auto-detects whether it's being invoked for ssr.
48+
*/
49+
ssr?: boolean
4650
}
4751

4852
export interface ResolvedOptions extends Options {
@@ -103,7 +107,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
103107
}
104108
},
105109

106-
load(id, ssr = false) {
110+
load(id, ssr = !!options.ssr) {
107111
const { filename, query } = parseVueRequest(id)
108112
// select corresponding block for subpart virtual modules
109113
if (query.vue) {
@@ -131,7 +135,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
131135
}
132136
},
133137

134-
transform(code, id, ssr = false) {
138+
transform(code, id, ssr = !!options.ssr) {
135139
const { filename, query } = parseVueRequest(id)
136140
if (!query.vue && !filter(filename)) {
137141
return

0 commit comments

Comments
 (0)