Problem/Motivation

I'm trying to load modules from a CDN, in particular pako with the following URL
https://unpkg.com/pako@2.1.0/dist/pako.esm.mjs
but I get an error since the module can only handle internal URLs.

Steps to reproduce

Define a external module in the MODULE.libraries.yml, for example:

pako:
  js:
    https://unpkg.com/pako@2.1.0/dist/pako.esm.mjs:
      type: external
      minified: true
      attributes:
        data-importmap-name: 'pako'

Proposed resolution

When the library is external just use the URL given in the definition.

Remaining tasks

Code

User interface changes

API changes

Data model changes

Issue fork importmap-3423691

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rodrigoaguilera created an issue. See original summary.

rodrigoaguilera’s picture

Status: Active » Needs review

prudloff made their first commit to this issue’s fork.

prudloff’s picture

Status: Needs review » Fixed

Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.