vue3-yuanma/packages/compiler-dom/src/index.ts

24 lines
615 B
TypeScript
Raw Normal View History

2019-09-20 04:12:37 +00:00
import {
compile as baseCompile,
CompilerOptions,
2019-09-20 04:12:37 +00:00
CodegenResult
} from '@vue/compiler-core'
import { parserOptionsMinimal } from './parserOptionsMinimal'
import { parserOptionsStandard } from './parserOptionsStandard'
2019-09-20 04:12:37 +00:00
export function compile(
template: string,
options: CompilerOptions = {}
): CodegenResult {
return baseCompile(template, {
...options,
...(__BROWSER__ ? parserOptionsMinimal : parserOptionsStandard),
2019-09-21 21:42:12 +00:00
directiveTransforms: {
// TODO include DOM-specific directiveTransforms
...(options.directiveTransforms || {})
}
2019-09-20 04:12:37 +00:00
})
}
2019-09-22 20:50:57 +00:00
export * from '@vue/compiler-core'