Skip to content

Commit

Permalink
fix(compiler-core): use the same resolved options for all compile sta…
Browse files Browse the repository at this point in the history
…ges (#9760)
  • Loading branch information
sxzz authored Dec 6, 2023
1 parent 8e27692 commit 0dc875d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/compiler-core/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export function baseCompile(
onError(createCompilerError(ErrorCodes.X_SCOPE_ID_NOT_SUPPORTED))
}

const ast = isString(source) ? baseParse(source, options) : source
const resolvedOptions = extend({}, options, {
prefixIdentifiers
})
const ast = isString(source) ? baseParse(source, resolvedOptions) : source
const [nodeTransforms, directiveTransforms] =
getBaseTransformPreset(prefixIdentifiers)

Expand All @@ -95,8 +98,7 @@ export function baseCompile(

transform(
ast,
extend({}, options, {
prefixIdentifiers,
extend({}, resolvedOptions, {
nodeTransforms: [
...nodeTransforms,
...(options.nodeTransforms || []) // user transforms
Expand All @@ -109,10 +111,5 @@ export function baseCompile(
})
)

return generate(
ast,
extend({}, options, {
prefixIdentifiers
})
)
return generate(ast, resolvedOptions)
}

0 comments on commit 0dc875d

Please sign in to comment.