Scripts: Build command deletes all files and directories in output path #39869
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Tool] WP Scripts
/packages/scripts
[Type] Bug
An existing feature does not function as intended
Description
When running the command
wp-scripts build --output-path=assets
all files and directories withinassets
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:
The build script will generate:
However it will also delete
plugin/assets/css/
andplugin/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
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
The text was updated successfully, but these errors were encountered: