feat: expose compiler APIs

This commit is contained in:
Evan You
2019-09-20 00:12:37 -04:00
parent 3b5ef483a9
commit d7aab859a3
7 changed files with 70 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ import { advancePositionWithMutation } from './utils'
export interface CodegenOptions {
// Assume ES module environment. If true, will generate import statements for
// runtime helpers; otherwise will grab the helpers from global `Vue`.
// default: false
module?: boolean
// Filename for source map generation.
filename?: string
@@ -68,7 +69,7 @@ function createCodegenContext(
options: CodegenOptions
): CodegenContext {
const context: CodegenContext = {
module: true,
module: false,
filename: `template.vue.html`,
...options,
source: ast.loc.source,