2019-09-20 04:12:37 +00:00
|
|
|
import {
|
2019-09-20 16:16:19 +00:00
|
|
|
compile as baseCompile,
|
|
|
|
CompilerOptions,
|
2019-09-20 04:12:37 +00:00
|
|
|
CodegenResult
|
|
|
|
} from '@vue/compiler-core'
|
2019-09-17 15:57:25 +00:00
|
|
|
import { parserOptionsMinimal } from './parserOptionsMinimal'
|
|
|
|
import { parserOptionsStandard } from './parserOptionsStandard'
|
|
|
|
|
2019-09-20 04:12:37 +00:00
|
|
|
export function compile(
|
|
|
|
template: string,
|
|
|
|
options: CompilerOptions = {}
|
|
|
|
): CodegenResult {
|
2019-09-20 16:16:19 +00:00
|
|
|
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'
|