expect(content).toMatch('return { get Foo() { return Foo } }')
assertCode(content)
})
+
+test('check when has explicit parse options', () => {
+ const { content } = compile(
+ `
+ <script setup lang="ts">
+ import { x } from './x'
+ </script>
+ <template>
+ {{ x }}
+ </template>
+ `,
+ undefined,
+ { templateParseOptions: {} },
+ )
+ expect(content).toMatch('return { get x() { return x } }')
+})
pad = false,
ignoreEmpty = true,
compiler = CompilerDOM,
- templateParseOptions = { prefixIdentifiers: true },
+ templateParseOptions = {},
} = options
const descriptor: SFCDescriptor = {
const errors: (CompilerError | SyntaxError)[] = []
const ast = compiler.parse(source, {
parseMode: 'sfc',
+ prefixIdentifiers: true,
...templateParseOptions,
onError: e => {
errors.push(e)