wip: allow scriptCompiled to be cached on sfc descriptor

This commit is contained in:
Evan You 2020-11-19 12:33:52 -05:00
parent 6541e70acb
commit 737ef424a0

View File

@ -20,6 +20,18 @@ export interface SFCParseOptions {
compiler?: TemplateCompiler compiler?: TemplateCompiler
} }
export interface SFCDescriptor {
filename: string
source: string
template: SFCTemplateBlock | null
script: SFCScriptBlock | null
scriptSetup: SFCScriptBlock | null
scriptCompiled: SFCScriptBlock | null
styles: SFCStyleBlock[]
customBlocks: SFCBlock[]
cssVars: string[]
}
export interface SFCBlock { export interface SFCBlock {
type: string type: string
content: string content: string
@ -49,17 +61,6 @@ export interface SFCStyleBlock extends SFCBlock {
module?: string | boolean module?: string | boolean
} }
export interface SFCDescriptor {
filename: string
source: string
template: SFCTemplateBlock | null
script: SFCScriptBlock | null
scriptSetup: SFCScriptBlock | null
styles: SFCStyleBlock[]
customBlocks: SFCBlock[]
cssVars: string[]
}
export interface SFCParseResult { export interface SFCParseResult {
descriptor: SFCDescriptor descriptor: SFCDescriptor
errors: (CompilerError | SyntaxError)[] errors: (CompilerError | SyntaxError)[]
@ -97,6 +98,7 @@ export function parse(
template: null, template: null,
script: null, script: null,
scriptSetup: null, scriptSetup: null,
scriptCompiled: null,
styles: [], styles: [],
customBlocks: [], customBlocks: [],
cssVars: [] cssVars: []