Description
Description
I'm trying to require the @editorjs/editorjs
package but unfortunately the jsdeliver powered endpoint seems to be broken
This is what I get in the downloaded file :
/**
* Failed to bundle using Rollup v2.79.1.
* If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr
*/
throw new Error('Failed to bundle using Rollup v2.79.1. If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr');
It seems to be an error from jsDeliver as the package.json
file from EditorJS hasn't been changed lately and the esm import works when using :
import Editor from 'https://esm.sh/@editorjs/[email protected]';
Adding an url option may be an easy fix at first, so that user can require any file from anywhere
Adding either another resolver to the import map package resolver (jspm.io, unpkg.com, esm.sh) could help to get around those error cases would also help to not get constrained by errors from CDN
Example
A) importmap:require url option
bin/console importmap:require @editorjs/editorjs --url=https://esm.sh/v135/@editorjs/[email protected]/es2022/editorjs.mjs
B) importmap:require resolver option
bin/console importmap:require @editorjs/editorjs --resolver=<resolver>
The resolver
option could be any class implementing Symfony\Component\AssetMapper\ImportMap\Resolver\PackageResolverInterface
and may be assigned an alias so that it can be used in the importmap:require
command