viewScriptModule is not included in build unless WP_EXPERIMENTAL_MODULES is set #64343
Open
2 tasks done
Labels
[Feature] Script Modules API
Related to the Script Modules API that adds support for native ES modules and import maps
[Tool] WP Scripts
/packages/scripts
[Type] Bug
An existing feature does not function as intended
Description
viewScriptModule
is documented to be available, but a view module set using it does not build.This may be what was referred to here: #61047
The work was originally done here: #57492
I think this line is where the issue is: https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/utils/config.js#L253
It checks the build type but this is supposed to be available for nonmodule builds, if I read this comment correctly: #57492 (comment)
Step-by-step reproduction instructions
viewScript
specified inblock.json
build
directory and see that the view script was compiledrm -rf build
viewScript
to aviewScriptModule
build
directory and see that the view module was not compiledScreenshots, screen recording, code snippet
No response
Environment info
I tested this with
@wordpress/scripts
28.4.0Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: