Skip to content
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: Change webpack configuration to include render files in the build folder #43917

Merged
merged 7 commits into from Sep 9, 2022
2 changes: 1 addition & 1 deletion docs/reference-guides/block-api/block-metadata.md
Expand Up @@ -632,7 +632,7 @@ return array(
Starting in the WordPress 5.8 release, it is possible to instruct WordPress to enqueue scripts and styles for a block type only when rendered on the frontend. It applies to the following asset fields in the `block.json` file:

- `script`
- `viewScript` (when the block defines `render_callback` during registration in PHP, then the block author is responsible for enqueuing the script)
- `viewScript` (when the block defines `render_callback` during registration in PHP or a `render` field in its `block.json`, then the script is registered but the block author is responsible for enqueuing it)
Copy link
Member

@gziolo gziolo Sep 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍🏻

Aside: Sharing for inspiration. It would be great to remove that limitation/exception and offer an alternative way to enqueue those view scripts on demand. Related Track ticket: https://core.trac.wordpress.org/ticket/56470.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, something like that would be neat 🙂

- `style`

## Internationalization
Expand Down