Skip to content

Commit 9cb29ee

Browse files
committed
fix(compiler-sfc): fix preprocessor filename access
1 parent 6136cf8 commit 9cb29ee

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/compiler-sfc/src/stylePreprocessors.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import merge from 'merge-source-map'
22
import path from 'path'
3+
import { RawSourceMap } from 'source-map'
4+
import { SFCStyleCompileOptions } from './compileStyle'
35

46
export interface StylePreprocessor {
57
render(
68
source: string,
7-
map?: object,
8-
options?: any,
9-
customRequire?: (id: string) => any
9+
map: RawSourceMap | undefined,
10+
options: {
11+
[key: string]: any
12+
filename: string
13+
},
14+
customRequire: SFCStyleCompileOptions['preprocessCustomRequire']
1015
): StylePreprocessorResults
1116
}
1217

@@ -83,7 +88,7 @@ const less: StylePreprocessor = {
8388
// less output path is relative path
8489
const dependencies = getAbsolutePaths(
8590
result.imports,
86-
path.dirname(options.fileName)
91+
path.dirname(options.filename)
8792
)
8893
if (map) {
8994
return {

0 commit comments

Comments
 (0)