From ce0ba59af8844417e96c710fa2e4ef2d8294f364 Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Tue, 15 Mar 2022 10:44:49 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-10608=20refactor:=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E6=89=93=E5=8C=85=E6=94=B9=E6=88=90=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/prepublish/prepublish.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/prepublish/prepublish.js b/lib/prepublish/prepublish.js index 5a8f9034e..c663782a7 100644 --- a/lib/prepublish/prepublish.js +++ b/lib/prepublish/prepublish.js @@ -45,7 +45,8 @@ function finalizeCompile() { let lessContent = ''; bundleWithoutNormalize.forEach(path => { - lessContent += `@import "../.${path}";\n`; + const relativePath = path.replace(/.*src\/less/, 'src/less').replace(/.*public\/less/g, 'public/less'); + lessContent += `@import "../../${relativePath}";\n`; }); writeFileSync(