template: string | RootNode,
options: CompilerOptions = {}
): CodegenResult {
- if (__BROWSER__ && options.prefixIdentifiers) {
+ if (__BROWSER__ && options.prefixIdentifiers === false) {
;(options.onError || defaultOnError)(
createCompilerError(ErrorCodes.X_PREFIX_ID_NOT_SUPPORTED)
)
const ast = isString(template) ? parse(template, options) : template
+ const prefixIdentifiers = !__BROWSER__ && options.prefixIdentifiers === true
transform(ast, {
...options,
- prefixIdentifiers: !__BROWSER__ && options.prefixIdentifiers === true,
+ prefixIdentifiers,
nodeTransforms: [
transformIf,
transformFor,
- transformExpression,
+ ...(prefixIdentifiers ? [transformExpression] : []),
transformElement,
...(options.nodeTransforms || []) // user transforms
],
...(options.directiveTransforms || {}) // user transforms
}
})
+
return generate(ast, options)
}