From d3916b69b491bb0964102b69a8bb2e9336f7677b Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 20 Jun 2022 15:48:54 +0800 Subject: [PATCH] feat(sfc): parse needMap compat --- packages/compiler-sfc/src/parse.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/compiler-sfc/src/parse.ts b/packages/compiler-sfc/src/parse.ts index 6901238117d..2203ab89ce3 100644 --- a/packages/compiler-sfc/src/parse.ts +++ b/packages/compiler-sfc/src/parse.ts @@ -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)