Skip to content

Commit

Permalink
fix(compiler-sfc): fix preprocessor filename access
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 16, 2020
1 parent 6136cf8 commit 9cb29ee
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/compiler-sfc/src/stylePreprocessors.ts
Original file line number Diff line number Diff line change
@@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9cb29ee

Please sign in to comment.