diff --git a/packages/compiler-sfc/src/compileTemplate.ts b/packages/compiler-sfc/src/compileTemplate.ts index 019aa5b0d65..5b7fe268366 100644 --- a/packages/compiler-sfc/src/compileTemplate.ts +++ b/packages/compiler-sfc/src/compileTemplate.ts @@ -219,6 +219,7 @@ function doCompileTemplate({ // We need to parse a fresh one. Can't just use `source` here since we need // the AST location info to be relative to the entire SFC. const newAST = (ssr ? CompilerDOM : compiler).parse(inAST.source, { + ...compilerOptions, parseMode: 'sfc', onError: e => errors.push(e), }) diff --git a/packages/sfc-playground/src/App.vue b/packages/sfc-playground/src/App.vue index de6c24dded0..e8aeeeaef56 100644 --- a/packages/sfc-playground/src/App.vue +++ b/packages/sfc-playground/src/App.vue @@ -70,8 +70,8 @@ const sfcOptions: SFCOptions = { template: { isProd: useProdMode.value, compilerOptions: { - isCustomElement: (tag: string) => tag === 'mjx-container' - } + isCustomElement: (tag: string) => tag === 'mjx-container', + }, }, }