Skip to content

Commit b45f379

Browse files
committed
chore: fix build script for windows
1 parent 38995ac commit b45f379

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/build-styles.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ export default async function buildStyles() {
9292
if (file === 'swiper.scss' || file === 'swiper.less') {
9393
distFileContent = `${banner()}\n${distFileContent}`;
9494
}
95-
if (distFilePath.includes('/modules/')) {
96-
distFilePath = distFilePath.replace(/modules\/([a-zA-Z0-9-]*)/, 'modules');
95+
if (distFilePath.includes('/modules/') || distFilePath.includes('\\modules\\')) {
96+
distFilePath = distFilePath
97+
.replace(/modules\/([a-zA-Z0-9-]*)/, 'modules')
98+
.replace(/modules\\([a-zA-Z0-9-]*)/, 'modules');
9799
}
98100
await fs.ensureDir(path.dirname(distFilePath));
99101
await fs.writeFile(distFilePath, distFileContent);

0 commit comments

Comments
 (0)