Skip to content

Commit

Permalink
fix(compiler-core): support ts syntax in expressions when isTS is true
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 20, 2021
1 parent e9c0694 commit 0dc521b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/compiler-core/src/compile.ts
Expand Up @@ -85,6 +85,14 @@ export function baseCompile(
const ast = isString(template) ? baseParse(template, options) : template
const [nodeTransforms, directiveTransforms] =
getBaseTransformPreset(prefixIdentifiers)

if (!__BROWSER__ && options.isTS) {
const { expressionPlugins } = options
if (!expressionPlugins || !expressionPlugins.includes('typescript')) {
options.expressionPlugins = [...(expressionPlugins || []), 'typescript']
}
}

transform(
ast,
extend({}, options, {
Expand Down

0 comments on commit 0dc521b

Please sign in to comment.