Skip to content

Commit

Permalink
fix: always use absolute paths for less imports (#495) (#496)
Browse files Browse the repository at this point in the history
Co-authored-by: Per Thomas Lundal <pt@lundal.io>
  • Loading branch information
lundal and lundal committed Apr 4, 2022
1 parent 2ba154a commit be0fda4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/transformers/less.ts
@@ -1,3 +1,5 @@
import { isAbsolute, join } from 'path';

import less from 'less';

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

const dependencies = imports.map((path: string) =>
isAbsolute(path) ? path : join(process.cwd(), path),
);

return {
code: css,
map,
dependencies: imports,
dependencies,
};
};

Expand Down

0 comments on commit be0fda4

Please sign in to comment.