-
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
Scripts: Add new flag to allow customization of the src
directory.
#39618
Merged
ryanwelcher
merged 18 commits into
WordPress:trunk
from
ryanwelcher:try/scripts-custom-src-directory
Apr 5, 2022
Merged
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c8a9c01
Add new flag to allow customization of the src directory.
ryanwelcher f334906
Add new flag to the build command.
ryanwelcher 6465545
Update changelog.
ryanwelcher 6438856
Add npmDevDependencies as a template variable. Update messaging to sh…
ryanwelcher 6f24eb8
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher 37ec581
Let's try dynamic entry points
gziolo c5a2b68
Update packages/scripts/CHANGELOG.md
gziolo 4e2af84
Merge branch 'trunk' into try/scripts-custom-src-directory
gziolo 19b81b0
Ensure that `block.json` is always loaded fresh in watch mode
gziolo c980cd2
Update CHANGELOG.md
gziolo 0f50fcf
Update packages/scripts/utils/config.js
ryanwelcher 0b691cc
Merge remote-tracking branch 'upstream/trunk' into trunk
ryanwelcher 1ed44fc
Merge branch 'trunk' into try/scripts-custom-src-directory
ryanwelcher 727ba85
Merge branch 'try/scripts-custom-src-directory' of github.com:ryanwel…
ryanwelcher 188f23f
Remove duplicated code from merge.
ryanwelcher 6d6b943
Fix typo for WebPack.
ryanwelcher c7075da
Formatting updates.
ryanwelcher 04b0606
Updates to README.
ryanwelcher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
I remember some folks reporting a similar message on the terminal was confusing in case they using a custom config that overrides the entry points.
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.
It made me think that we could use a dynamic entry as documented in https://webpack.js.org/configuration/entry-context/#dynamic-entry. We would never run this code when the project overrides entry points.
In fact, this would solve a more pressing issue we recently discovered with @schmitzoide when working on a plugin with multiple blocks. Currently, the logic for finding entry points runs only once in the watch mode. Therefore you need to restart the development build whenever new blocks get introduced or scripts for the block change. Using a callback function should resolve the issue.
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.
Related comment I mentioned: #38739 (comment).
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.
@gziolo @ryanwelcher Hope this PR resolves the confusing behaviour for #38739 (comment)
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.
I added commit 37ec581 to see if that resolves the issue.
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.
I can confirm that the message isn't shown when we use the default handling for entry points.
I can also confirm that entry points get dynamically updated in the watch mode when
block.json
changes.