Skip to content

Commit

Permalink
fix: yarn web failed in windows (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortalYoung authored Apr 6, 2022
1 parent 4c809eb commit 05ad264
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function replacePath(code, filePath, importOptions) {
const sourcePath = path.dirname(filePath);
const targetPath = path.resolve(output);
const relativePath = path.relative(sourcePath, targetPath);
const finalPath = relativePath ? './' + relativePath + '/' : './';
// transform different platform separator to linux's separator
const finalPath = relativePath
? './' + relativePath.split(path.sep).join('/') + '/'
: './';
return code.replace(/([from|import]\s+)'(mo\/|\bmo\b)/g, "$1'" + finalPath);
}

Expand Down

0 comments on commit 05ad264

Please sign in to comment.