Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): make writefile path compatible posix and windows system #13270

Merged
merged 4 commits into from Sep 17, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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})`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB you'll need to remove this line too

Suggested change
const {sep} = path;
const replaceDirReg = new RegExp(`(?<=\\${sep})(dist)(?=\\${sep})`);
const {sep} = path;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,i remove it😊

await fs.promises.writeFile(
filepath.replace('/dist/', '/build/'),
filepath.replace(`${sep}dist${sep}`, `${sep}build${sep}`),
formattedContent,
);
}),
Expand Down