From 0984bae2cceb28d7338fa1716c3059f15b54533d Mon Sep 17 00:00:00 2001 From: aoxiang78 Date: Wed, 7 Jul 2021 17:53:14 +0800 Subject: [PATCH] fix: path error when packaging the component style export file in the windeos environment (#31277) In the windeos environment: "Lib/style/components.less" will generate the following path "@import "../xx\style\index.less";" This is wrong Now use path.posix.join to be compatible with multi-platform packaging --- .antd-tools.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.antd-tools.config.js b/.antd-tools.config.js index 97d5728c32..b721859d39 100644 --- a/.antd-tools.config.js +++ b/.antd-tools.config.js @@ -22,7 +22,7 @@ function finalizeCompile() { fs.readdir(componentsPath, (err, files) => { files.forEach(file => { if (fs.existsSync(path.join(componentsPath, file, 'style', 'index.less'))) { - componentsLessContent += `@import "../${path.join(file, 'style', 'index.less')}";\n`; + componentsLessContent += `@import "../${path.posix.join(file, 'style', 'index.less')}";\n`; } }); fs.writeFileSync(