Problem/Motivation
Quickly tried to use our package via Unpkg's module option and encountered an error.
https://unpkg.com/@drupal-api-client/json-api-client@0.1.0/dist/index.js?module
Doesn't necessarily have to be unpkg, but I'd love to be able to provide an option for this client to be used via a CDN.
Steps to reproduce
Load: https://unpkg.com/@drupal-api-client/json-api-client@0.1.0/dist/index.js?module
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork api_client-3400583
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
Comment #3
brianperryComment #4
brianperryIt actually looks like jsdelivr / esm.run is smart enough to handle this today.
https://esm.run/@drupal-api-client/json-api-client
Codepen:
https://codepen.io/brianperry/pen/gOyboza
Still don't see how targeting es2020 would hurt. Would be nice to support unpkg as well.
Comment #5
coby.sher commentedComment #6
brianperryThe most recent release did in fact resolve the error when using json-api-client as a module on unpkg:
https://unpkg.com/@drupal-api-client/json-api-client@0.7.2/dist/index.mjs?module
But I still can't seem to use it in a codepen:
https://codepen.io/brianperry/pen/BaELdOx?editors=1111
I think we can mark this as fixed though - we have one functional CDN example we can suggest. We can open an issue specific to unpkg if there is demand.