[wp-trac] [WordPress Trac] #56313: wp_enqueue_script needs to be able to handle modules (ES6/ES2020)

WordPress Trac noreply at wordpress.org
Wed Feb 22 00:42:38 UTC 2023


#56313: wp_enqueue_script needs to be able to handle modules (ES6/ES2020)
---------------------------+------------------------------
 Reporter:  idad5          |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  2nd-opinion    |     Focuses:  javascript
---------------------------+------------------------------

Comment (by neffff):

 I came here looking for this!  I wanted to add an additional
 concern/wrinkle.  In supporting modules (which as noted can be done with a
 simple filter). It seems adding support for the
 [https://developer.mozilla.org/en-
 US/docs/Web/HTML/Element/script/type/importmap `importmap` script type]
 would make this a great addition to the script loader.

 This would allow modules to have configurable imports -- enabling sharing
 modules between front/back ends without having to transpile.  I'm sure
 there are other benefits, but this was the one that sent me looking for
 that support.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56313#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list