Skip to content

Commit

Permalink
chore: fix build script for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 17, 2023
1 parent 38995ac commit b45f379
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/build-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ export default async function buildStyles() {
if (file === 'swiper.scss' || file === 'swiper.less') {
distFileContent = `${banner()}\n${distFileContent}`;
}
if (distFilePath.includes('/modules/')) {
distFilePath = distFilePath.replace(/modules\/([a-zA-Z0-9-]*)/, 'modules');
if (distFilePath.includes('/modules/') || distFilePath.includes('\\modules\\')) {
distFilePath = distFilePath
.replace(/modules\/([a-zA-Z0-9-]*)/, 'modules')
.replace(/modules\\([a-zA-Z0-9-]*)/, 'modules');
}
await fs.ensureDir(path.dirname(distFilePath));
await fs.writeFile(distFilePath, distFileContent);
Expand Down

0 comments on commit b45f379

Please sign in to comment.