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

Scripts: Build command deletes all files and directories in output path #39869

Open
sjregan opened this issue Mar 30, 2022 · 3 comments
Open
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Package] Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects

Comments

@sjregan
Copy link

sjregan commented Mar 30, 2022

Description

When running the command wp-scripts build --output-path=assets all files and directories within assets are deleted.

I expect the directories created and populated by the build script to be reset, not other files and directories.

My plugin has the following directory structure:

plugin/assets/
plugin/assets/css/
plugin/assets/images/
plugin/src/blocks/types/block1/
plugin/src/blocks/types/block1/block.json
plugin/src/blocks/types/block2/
plugin/src/blocks/types/block2/block.json

The build script will generate:

plugin/assets/blocks/types/block1/block.json
plugin/assets/blocks/types/block2/block.json

However it will also delete plugin/assets/css/ and plugin/assets/images.

I would expect all the files and directories within plugin/assets/blocks/ to be removed and rebuilt, but not files and directories outside that directory.

Step-by-step reproduction instructions

  1. Create a plugin with the directory structure above
  2. Run wp-scripts build --output-path=assets

Screenshots, screen recording, code snippet

No response

Environment info

@wordpress/scripts: 22.3.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Soean Soean added the [Package] Scripts /packages/scripts label Mar 30, 2022
@gziolo gziolo added the Needs Technical Feedback Needs testing from a developer perspective. label Apr 1, 2022
@gziolo gziolo added this to To do in Core JS Apr 1, 2022
@gziolo gziolo changed the title Build script deletes all files and directories in output path Scripts: Build command deletes all files and directories in output path Apr 1, 2022
@gziolo
Copy link
Member

gziolo commented Apr 7, 2022

@ryanwelcher, can you help with that one. I think you are working on something related in #39653.

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Hi,
This issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the Needs Testing Needs further testing to be confirmed. label Oct 5, 2022
@Mamaduka Mamaduka removed the Needs Testing Needs further testing to be confirmed. label Oct 18, 2022
@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Sep 14, 2023
@sjregan
Copy link
Author

sjregan commented Apr 15, 2024

Still occurs in v27.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective. [Package] Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
Projects
No open projects
Core JS
  
To do
Development

No branches or pull requests

5 participants