-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
WP Scripts: Make watch mode more resilient for developer errors #66752
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
For reference, the previous contribution from @fabiankaegy which added improved support for |
Size Change: 0 B Total Size: 1.82 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks for these fixes 👍
What?
Extracted from #66466 (comment):
Why?
This was useful in the watch mode when running
wp-scripts start
as it allowed developers made mistakes during development. There would be an error message displayed in the terminal that should help to resolve the issue without running the same command again.How?
Testing Instructions
I created a custom block from the Gutenberg repository and put it in the watch mode with:
npx wp-create-block example-block --no-wp-scripts cd example-block npx ../node_modules/.bin/wp-scripts start
I made an error in
block.json
file to ensure it errors. I was able to see the warning coming from webpack config and the error coming from the bundler for the usage of import inside the JS code forblock.json
. The command continued to work and resumed to fully operational after I fixed the JSON file and saved it again.Some examples after the changes applied with this PR while webpack continues to run in the watch mode: