[wp-trac] [WordPress Trac] #61771: Script Modules: add the importmap's scopes key

WordPress Trac noreply at wordpress.org
Fri Sep 27 17:15:44 UTC 2024


#61771: Script Modules: add the importmap's scopes key
---------------------------+------------------------------
 Reporter:  rosua          |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  6.5
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  javascript
---------------------------+------------------------------

Comment (by brookepena):

 **I totally agree with rosua**


 {{{
 function print_import_map() {
     global $wp_import_map;

     if (empty($wp_import_map)) {
         return;
     }

     // Start outputting the JSON structure
     $import_map = json_encode($wp_import_map, JSON_PRETTY_PRINT);

     echo "<script type=\"importmap\">\n" . $import_map . "\n</script>\n";
 }

 }}}
 {{{
 #!html
 <a href="https://gowa-meble.pl"></a>
 <a href="https://doradnik.pl"></a>
 <a href="https://orlexmg.pl"></a>
 <a href="https://drogeriaestetic.pl"></a>
 <a href="https://www.adwokat-zgierz.com.pl"></a>
 <a href="https://www.maxsee.pl"></a>
 }}}

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


More information about the wp-trac mailing list