Skip to content

Commit

Permalink
build: fix style path error on Windows platform (#2693)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz authored and vthinkxie committed Jan 17, 2019
1 parent 599ae1a commit c6d2706
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build/generate-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const targetFolder = fs.readdirSync(targetPath);
let componentsLessContent = '';
targetFolder.forEach(dir => {
if (fs.existsSync(`${sourcePath}/${dir}/style/index.less`)) {
componentsLessContent += `@import "./${path.join(dir, 'style', 'index.less')}";\n`
componentsLessContent += `@import "./${path.posix.join(dir, 'style', 'index.less')}";\n`;
fs.copySync(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`);
}
}
)
);
fs.copySync(path.resolve(sourcePath, 'style'), path.resolve(targetPath, 'style'));
fs.writeFileSync(`${targetPath}/components.less`, componentsLessContent);
fs.writeFileSync(`${targetPath}/ng-zorro-antd.less`, fs.readFileSync(`${sourcePath}/ng-zorro-antd.less`));

const lessContent = `@import "${path.join(targetPath, 'ng-zorro-antd.less')}";`;
const lessContent = `@import "${path.posix.join(targetPath, 'ng-zorro-antd.less')}";`;
compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.css'), false);
compileLess(lessContent, path.join(targetPath, 'ng-zorro-antd.min.css'), true);

0 comments on commit c6d2706

Please sign in to comment.