Skip to content

Conversation

@paulirish
Copy link
Member

fixes #12800 ( i could repro )

@paulirish paulirish requested a review from a team as a code owner July 27, 2021 20:07
@paulirish paulirish requested review from adamraine and removed request for a team July 27, 2021 20:07
@google-cla google-cla bot added the cla: yes label Jul 27, 2021
@paulirish paulirish changed the title build: ensure distDir is present before emptying it misc(build): ensure distDir is present before emptying it Jul 27, 2021

fs.mkdirSync(distDir, {recursive: true}); // Ensure dist is present, else rmdir will throw
fs.rmdirSync(distDir, {recursive: true});
fs.mkdirSync(distDir);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead we can use fs.rmSync with force: true and recursive: true.

Copy link
Contributor

Choose a reason for hiding this comment

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

rm/rmSync aren't supported until Node 14

Copy link
Member Author

@paulirish paulirish Jul 27, 2021

Choose a reason for hiding this comment

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

rmSync is new in node 14. (not in 12). :/

fsPromises.rmdir has force, but will require a bigger diff in this file. jk, my mistake. need the rm method in sync or promises versions. both need node 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yarn build:all throws exception upon building from source

5 participants