diff --git a/lib/prepublish/prepublish.js b/lib/prepublish/prepublish.js index 5a8f9034e..4f082ab6a 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/, 'public/less'); + lessContent += `@import "../../${relativePath}";\n`; }); writeFileSync(