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

Make yarn build command cross-platform #3747

Merged

Conversation

alexanderleecii
Copy link
Contributor

@alexanderleecii alexanderleecii commented Jun 16, 2024

Short description

The build npm script currently fails on non-unix platforms where rm is not defined. This PR makes the script cross-platform.
Resolves #3746

Implementation details

  1. Created a scripts/clean.cjs script to recursively delete dist folder using nodejs APIs
  2. Added a clean npm script which calls scripts/clean.cjs
  3. Call npm run clean instead of rm -rf dist in build npm script

How to test it

Run yarn build. Any existing dist folder should be removed and the build process should execute correctly.

Checklist

  • This PR is covered by e2e tests
  • It introduces no breaking API changes

@alexanderleecii alexanderleecii changed the title Make npm build command cross-platform Make yarn build command cross-platform Jun 16, 2024
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Thanks!

scripts/clean.cjs Outdated Show resolved Hide resolved
Co-authored-by: katspaugh <381895+katspaugh@users.noreply.github.com>
Copy link
Owner

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

👍

@katspaugh katspaugh merged commit 08afa79 into katspaugh:main Jun 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build: yarn build fails on Windows
2 participants