feat(sfc): parse needMap compat

This commit is contained in:
Evan You 2022-06-20 15:48:54 +08:00
parent 8ab0074bab
commit d3916b69b4

View File

@ -23,6 +23,10 @@ export interface SFCParseOptions {
compilerParseOptions?: VueTemplateCompilerParseOptions
sourceRoot?: string
sourceMap?: boolean
/**
* @deprecated use `sourceMap` instead.
*/
needMap?: boolean
}
export function parse(options: SFCParseOptions): SFCDescriptor {
@ -32,7 +36,8 @@ export function parse(options: SFCParseOptions): SFCDescriptor {
compiler,
compilerParseOptions = { pad: false } as VueTemplateCompilerParseOptions,
sourceRoot = '',
sourceMap = true
needMap = true,
sourceMap = needMap
} = options
const cacheKey = hash(
filename + source + JSON.stringify(compilerParseOptions)