22 lines
732 B
TypeScript
22 lines
732 B
TypeScript
import { baseCompile, CompilerOptions, CodegenResult } from '@vue/compiler-core'
|
|
import { parserOptionsMinimal } from './parserOptionsMinimal'
|
|
import { parserOptionsStandard } from './parserOptionsStandard'
|
|
import { transformStyle } from './transforms/transformStyle'
|
|
|
|
export function compile(
|
|
template: string,
|
|
options: CompilerOptions = {}
|
|
): CodegenResult {
|
|
return baseCompile(template, {
|
|
...options,
|
|
...(__BROWSER__ ? parserOptionsMinimal : parserOptionsStandard),
|
|
nodeTransforms: [transformStyle, ...(options.nodeTransforms || [])],
|
|
directiveTransforms: {
|
|
// TODO include DOM-specific directiveTransforms
|
|
...(options.directiveTransforms || {})
|
|
}
|
|
})
|
|
}
|
|
|
|
export * from '@vue/compiler-core'
|