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

[Feature] Clean/delete dist before building #1227

Closed
2 tasks done
Vivek205 opened this issue Apr 21, 2020 · 4 comments
Closed
2 tasks done

[Feature] Clean/delete dist before building #1227

Vivek205 opened this issue Apr 21, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Vivek205
Copy link

  • I'd be willing to implement this feature
  • This feature can already be implemented through a plugin - rimraf

Describe the user story

Everytime I have to manually clear the dist folder before running the build script. Else, the old files sitting already in the dist folder are causing trouble by polluting imports.

Describe the solution you'd like

I want a script to clear the existing dist file before building the package. So it could be automated. And I won't run into the issue of old files again. It will be somewhat similar to yarn autoclean but autoclean remove files only inside the node_modules.

Describe the drawbacks of your solution

I can't think of any at this moment

Describe alternatives you've considered

I considered using rimraf that is the only cross-platform alternative as per my knowledge.

@Vivek205 Vivek205 added the enhancement New feature or request label Apr 21, 2020
@Vivek205 Vivek205 changed the title [Feature] [Feature] Clean dist before building Apr 21, 2020
@merceyz
Copy link
Member

merceyz commented Apr 21, 2020

I considered using rimraf that is the only cross-platform alternative as per my knowledge.

Yarn has built-in support for rm -rf in scripts

EDIT: I had that wrong, I was thinking about environment variables

@Vivek205 Vivek205 changed the title [Feature] Clean dist before building [Feature] Clean/delete dist before building Apr 21, 2020
@Vivek205
Copy link
Author

I considered using rimraf that is the only cross-platform alternative as per my knowledge.

Yarn has built-in support for rm -rf in scripts

Yh. but that works only for the linux machines. In windows machine it will not work. That's why I'm looking for a cross platform solution

@arcanis
Copy link
Member

arcanis commented Apr 21, 2020

You want git clean -df, probably. In any case, I don't think that's something Yarn should do.

@paul-soporan
Copy link
Member

Closing this as it's outside the scope of Yarn. Also, we don't know which scripts create build folders when run and we can't magically extract the folder path from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants