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(