Skip to content

Commit be0fda4

Browse files
authored
fix: always use absolute paths for less imports (#495) (#496)
Co-authored-by: Per Thomas Lundal <[email protected]>
1 parent 2ba154a commit be0fda4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/transformers/less.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { isAbsolute, join } from 'path';
2+
13
import less from 'less';
24

35
import { getIncludePaths } from '../modules/utils';
@@ -20,10 +22,14 @@ const transformer: Transformer<Options.Less> = async ({
2022
...options,
2123
});
2224

25+
const dependencies = imports.map((path: string) =>
26+
isAbsolute(path) ? path : join(process.cwd(), path),
27+
);
28+
2329
return {
2430
code: css,
2531
map,
26-
dependencies: imports,
32+
dependencies,
2733
};
2834
};
2935

0 commit comments

Comments
 (0)