From: Evan You Date: Thu, 16 Jul 2020 17:34:59 +0000 (-0400) Subject: fix(compiler-sfc): fix preprocessor filename access X-Git-Tag: v3.0.0-beta.24~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cb29eea3a61f7f4a6730fed56f2e3e9a13dbcc9;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): fix preprocessor filename access --- diff --git a/packages/compiler-sfc/src/stylePreprocessors.ts b/packages/compiler-sfc/src/stylePreprocessors.ts index 13e9f9769f..31a9837934 100644 --- a/packages/compiler-sfc/src/stylePreprocessors.ts +++ b/packages/compiler-sfc/src/stylePreprocessors.ts @@ -1,12 +1,17 @@ import merge from 'merge-source-map' import path from 'path' +import { RawSourceMap } from 'source-map' +import { SFCStyleCompileOptions } from './compileStyle' export interface StylePreprocessor { render( source: string, - map?: object, - options?: any, - customRequire?: (id: string) => any + map: RawSourceMap | undefined, + options: { + [key: string]: any + filename: string + }, + customRequire: SFCStyleCompileOptions['preprocessCustomRequire'] ): StylePreprocessorResults } @@ -83,7 +88,7 @@ const less: StylePreprocessor = { // less output path is relative path const dependencies = getAbsolutePaths( result.imports, - path.dirname(options.fileName) + path.dirname(options.filename) ) if (map) { return {