3 ms·
You should download from npm. Neither UNPKG nor jsDelivr is considered authoritative.
by benatkin 4y ago
You should download from npm. Neither UNPKG nor jsDelivr is considered authoritative.
- simonw 4y agoThe problem I'm trying to solve is "give me an ECMAScript module version of this package, and fetch all of the dependencies too, in a way that I can use in a browser without needing a build system". If you know of the npm recipe for doing that I'd love to learn it - I'm fine running npm once to grab the module versions of things (which I intend to vendor in my repo), as long as I don't have to use any build tooling after that point.
- spankalee 4y agonpm + an import map generator should work. I think you might be able to use the jspm import map generator via the `jspm link` command: https://jspm.org/docs/jspm-cli/stable/#link https://jspm.org/docs/jspm-cli/stable/#link
- benatkin 4y agoA wrapper bundle is what I prefer right now, here is a wrapper bundle I made for CodeMirror 6. It just provides the needed exports from the library. It can also be verified on the client side with UNPKG or jsDelivr. My client side build prints out the integrity attribute. I still need to write the npm bundling code so at the moment I am relying on UNPKG. https://codeberg.org/macchiato/editor-lib-codemirror/src/branch/pages/app.js https://codeberg.org/macchiato/editor-lib-codemirror/src/bra... The rollup output is nice. I don't have terser, though I may add it later. When I added a couple exports the diff was just the change in my code. The library using it can include the integrity attribute and a can go here and run the build after checking the html and JavaScript file and check the output (codeberg.page is like GitHub pages in that it the repo contents controls what it serves): https://macchiato.codeberg.page/editor-lib-codemirror/ https://macchiato.codeberg.page/editor-lib-codemirror/