Skip to content

Commit 05ad264

Browse files
authored
fix: yarn web failed in windows (#719)
1 parent 4c809eb commit 05ad264

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build/gulpfile.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function replacePath(code, filePath, importOptions) {
1313
const sourcePath = path.dirname(filePath);
1414
const targetPath = path.resolve(output);
1515
const relativePath = path.relative(sourcePath, targetPath);
16-
const finalPath = relativePath ? './' + relativePath + '/' : './';
16+
// transform different platform separator to linux's separator
17+
const finalPath = relativePath
18+
? './' + relativePath.split(path.sep).join('/') + '/'
19+
: './';
1720
return code.replace(/([from|import]\s+)'(mo\/|\bmo\b)/g, "$1'" + finalPath);
1821
}
1922

0 commit comments

Comments
 (0)