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