Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#61356 new enhancement

Add $is_module as an extra strategy argument when enqueueing js script.

Reported by: itumulak's profile itumulak Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Script Loader Keywords: 2nd-opinion dev-feedback
Focuses: javascript, sustainability Cc:


With Modules API not able to utilize wp_localize_script, would it make sense to add an is_module option as another argument for wp_enqueue_script or wp_register_script? When set to true, type="module" is added in the script tag.

I have created my own Script Module class so that I can use JavaScript modules and localize scripts. See here.

First time here. Feedback is very welcome.

Change History (1)

#1 @jonsurrell
6 weeks ago

  • Focuses javascript added

This is related to #60234 and #60647.

Note: See TracTickets for help on using tickets.