[wp-trac] [WordPress Trac] #61500: Script Modules: Allow scripts to depend on modules
WordPress Trac
noreply at wordpress.org
Tue Jan 27 07:17:45 UTC 2026
#61500: Script Modules: Allow scripts to depend on modules
-------------------------------------+-------------------------------------
Reporter: jonsurrell | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 7.0
Component: Script Loader | Version: 6.5
Severity: normal | Resolution:
Keywords: has-patch has-unit- | Focuses: javascript,
tests | performance
-------------------------------------+-------------------------------------
Comment (by westonruter):
I just left a [https://core.trac.wordpress.org/ticket/48456#comment:17
comment] in #48456 with a workaround:
> Note that since classic scripts cannot explicitly depend on script
modules (#61500), this is currently implemented as a bit of a hack. A new
`wp-codemirror` script module is registered with an empty string `src`.
This module has `espree` added as a dynamic dependency. The empty string
has the effect of preventing the `wp-codemirror` script module from being
printed, while at the same time any of its dependencies still get added to
the `importmap`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61500#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list