Skip to content

Commit

Permalink
fix: always use absolute paths for less imports (sveltejs#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
lundal committed Apr 1, 2022
1 parent 2ba154a commit 4321945
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/transformers/less.ts
Original file line number Diff line number Diff line change
@@ -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 4321945

Please sign in to comment.