From be0fda4ddbe95040221ff248ccbb492fb5555334 Mon Sep 17 00:00:00 2001 From: Per Thomas Lundal Date: Mon, 4 Apr 2022 10:36:56 +0200 Subject: [PATCH] fix: always use absolute paths for less imports (#495) (#496) Co-authored-by: Per Thomas Lundal --- src/transformers/less.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/transformers/less.ts b/src/transformers/less.ts index 7a7289a2..508e1006 100644 --- a/src/transformers/less.ts +++ b/src/transformers/less.ts @@ -1,3 +1,5 @@ +import { isAbsolute, join } from 'path'; + import less from 'less'; import { getIncludePaths } from '../modules/utils'; @@ -20,10 +22,14 @@ const transformer: Transformer = async ({ ...options, }); + const dependencies = imports.map((path: string) => + isAbsolute(path) ? path : join(process.cwd(), path), + ); + return { code: css, map, - dependencies: imports, + dependencies, }; };