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

viewScriptModule is not included in build unless WP_EXPERIMENTAL_MODULES is set #64343

Open
2 tasks done
SeanMcMillan opened this issue Aug 7, 2024 · 0 comments
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

Comments

@SeanMcMillan
Copy link
Contributor

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

  1. Make a block with a viewScript specified in block.json
  2. run build
  3. look at the build directory and see that the view script was compiled
  4. rm -rf build
  5. change the viewScript to a viewScriptModule
  6. run build
  7. look at the build directory and see that the view module was not compiled

Screenshots, screen recording, code snippet

No response

Environment info

I tested this with @wordpress/scripts 28.4.0

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@SeanMcMillan SeanMcMillan added the [Type] Bug An existing feature does not function as intended label Aug 7, 2024
@talldan talldan added the [Tool] WP Scripts /packages/scripts label Aug 8, 2024
@gziolo gziolo added the [Feature] Script Modules API Related to the Script Modules API that adds support for native ES modules and import maps label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants