Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Replaces #12685.
This PR has been started by @griffbrad in #1268 and was desrbibed as follows (with some updates from myself):
Examples of Webpack configs used by plugins
How has this been tested?
The first thing to test with this PR is just a normal Gutenberg build because much of the webpack config has been extracted into a package. From what I can tell, everything still builds correctly, tests pass, and Gutenberg appears to function as expected.
Testing block building using
wp-scriptsis a bit tricky because you're running scripts from unpublished packages only available locally. To make this work, I do the following:npm run build.npm run copy-local-gutenberg-packages && npm i.npm run buildin the example plugin's folder. The block's code insrc/index.jswill be built with the output being placed inbuild.These testing instructions copy the built Gutenberg plugin and its packages into the example plugin itself because I've found that using a file ref to traverse back to the parent directory causes NPM to randomly crash and spew non-sense.
Types of changes
New feature
Checklist:
Planned follow-up tasks