Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21292

Enable use of native JavaScript Modules (import/export) with $xwiki.jsfx.use

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Trivial
    • None
    • 15.7
    • Other
    • Unknown

    Description

      To load a JavaScript file as a module that uses native import statements, it requires the type="module" parameter in the script tag:

       

      <script type="module" src="myfile.js"></script>

      It would be nice if we could specify this with $xwiki.jsfx.use(), similar to how defer is added:

      $xwiki.jsfx.use('myfile.js', {'type': 'module'})
      

      or even in conjunction with defer:

      $xwiki.jsfx.use('myfile.js', {'defer': false, 'type': 'module'}) 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Redhorse Rob Ostapiuk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: