feat(compiler-sfc): analyze script bindings (#1962)

Also expose `scriptAst` and `scriptSetupAst` on returned script block
This commit is contained in:
Stanislav Lashmanov
2020-08-28 23:21:03 +03:00
committed by GitHub
parent 94d94bafc5
commit 4421c00903
4 changed files with 337 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ import {
import * as CompilerDOM from '@vue/compiler-dom'
import { RawSourceMap, SourceMapGenerator } from 'source-map'
import { TemplateCompiler } from './compileTemplate'
import { Statement } from '@babel/types'
export interface SFCParseOptions {
filename?: string
@@ -37,6 +38,8 @@ export interface SFCScriptBlock extends SFCBlock {
type: 'script'
setup?: string | boolean
bindings?: BindingMetadata
scriptAst?: Statement[]
scriptSetupAst?: Statement[]
}
export interface SFCStyleBlock extends SFCBlock {