Dev server: minimize the "Module not found" error during rebuilds #722
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When developing our hooks library (commerce-sdk-react) and testing in the test-commerce project, we were seeing Module Not Found error pretty frequently. As a workaround, we had to restart our dev server. But doing so many times hurt our development flow.
I found webpack to be too eager to rebuild the app you're working on, whenever one of our sdk packages is being rebuilt. We needed a way to tell webpack to wait a bit before doing its rebuild. This PR adds a new watch option in the webpack config.
Ticket: W-11767052
Types of Changes
How to Test-Drive This PR
First of all, run the dev server in the test-commerce project, and then run a build watch in our hooks library:
Then in your code editor:
commerce-sdk-react
Some variations to try:
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization