Skip to content

Commit 33a5306

Browse files
committed
fix: ensure consistent user template options when reusing AST
ref: vitejs/vite-plugin-vue@bc0ad64
1 parent f1d8b96 commit 33a5306

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/utils/descriptorCache.ts

Lines changed: 2 additions & 1 deletion
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)