-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Change copying PHP files to dist directory to opt-in via a CLI flag. #39171
Change copying PHP files to dist directory to opt-in via a CLI flag. #39171
Conversation
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.
Thanks!
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.
Thank you @ryanwelcher for providing this fix. Let's keep it optional for now and maybe we can figure out some ways where we could extend the block.json
metadata in a way that allows automatically detecting necessary PHP block files.
…39171) * Enable accepting --webpack-copy-php flag from the CLI commands * Update the glob pattern based on existence of --webpack-copy-php flag. * Update README and changelog files. * Add PR to the changelog. * Update CHANGELOG.md * Update README.md Co-authored-by: Greg Ziółkowski <[email protected]>
Description
Based on feedback post #38715 being merged, this PR changes the approach around copying PHP files by moving to an opt-in approach via providing a
--webpack-copy-php
flag to either thestart
orbuild
commands. By moving to opt-in, we should be able to avoid more unintentional issues with existing projects while still allowing the functionality to be accessed.Testing Instructions
I created a block using npx @wordpress/create-block@ my-first-dynamic-block --template=@ryanwelcher/dynamic-block-template ( this contains an template.php file in the
src
directory )Then ran node {FULLPATH}/gutenberg/packages/scripts/bin/wp-scripts.js -- build --webpack-copy-php
Types of changes
Changes the approach for copying PHP files to be opt-in via a CLI flag.
Checklist:
*.native.js
files for terms that need renaming or removal).