Browse Source

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
pull/31294/head
aoxiang78 3 years ago
committed by GitHub
parent
commit
0984bae2cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .antd-tools.config.js

2
.antd-tools.config.js

@ -22,7 +22,7 @@ function finalizeCompile() {
fs.readdir(componentsPath, (err, files) => { fs.readdir(componentsPath, (err, files) => {
files.forEach(file => { files.forEach(file => {
if (fs.existsSync(path.join(componentsPath, file, 'style', 'index.less'))) { 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( fs.writeFileSync(

Loading…
Cancel
Save