Skip to content

Commit

Permalink
fix: make writefile path compatible posix and windows system
Browse files Browse the repository at this point in the history
  • Loading branch information
weidehai committed Sep 16, 2022
1 parent e703e6e commit 9f4933b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/bundleTs.mjs
Expand Up @@ -200,8 +200,10 @@ const excludedPackages = new Set(['@jest/globals']);
filepath,
});

const { sep } = path;
const replaceDirReg = new RegExp(`(?<=\\${sep})(dist)(?=\\${sep})`);
await fs.promises.writeFile(
filepath.replace('/dist/', '/build/'),
filepath.replace(replaceDirReg, 'build'),
formattedContent,
);
}),
Expand Down

0 comments on commit 9f4933b

Please sign in to comment.