Skip to content

Commit bc0ad64

Browse files
committed
fix: ensure consistent user template options when reusing AST
Note: requires vue 3.4.1 proper fix for #322
1 parent a13f09b commit bc0ad64

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/plugin-vue/src/template.ts

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export function resolveTemplateCompilerOptions(
186186
return {
187187
...options.template,
188188
id,
189+
ast: descriptor.template?.ast,
189190
filename,
190191
scoped: hasScoped,
191192
slotted: descriptor.slotted,

packages/plugin-vue/src/utils/descriptorCache.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ const prevCache = new Map<string, SFCDescriptor | undefined>()
2222
export function createDescriptor(
2323
filename: string,
2424
source: string,
25-
{ root, isProduction, sourceMap, compiler }: ResolvedOptions,
25+
{ root, isProduction, sourceMap, compiler, template }: ResolvedOptions,
2626
hmr = false,
2727
): SFCParseResult {
2828
const { descriptor, errors } = compiler.parse(source, {
2929
filename,
3030
sourceMap,
31+
templateParseOptions: template?.compilerOptions,
3132
})
3233

3334
// ensure the path is normalized in a way that is consistent inside

0 commit comments

Comments
 (0)