Is
/+esm
processed by jspm, not jsdelivr? I thought it was a special feature of jsdelivr where it dynamically builds a fully-bundled esm by inlining the imports listed in the “main” esm file. Is that not what’s happening?
sigh typo. Need to re-read before I post. Yes its a feature of jsdelivr only, not part of JSPM at all.
So the reasoning is a little complicated if you’ve never looked at package.json exports, but the TLDR is that this package implicitly decides what to give you based on how what environment its loaded in.
So for JSPM, it will automatically load the .esm.js
version.
These keys essentially define the “publicly importable files”
so the .cjs version will only work when using node const chart = require("chartjs-plugin-annotation")
for example.
Dont know if any of this helps, but its a wide chasm understanding the authoring keys for NPM packages. And also, if youre using importmaps, it expects everything to be ESM importable files because thats how the spec for importmaps module resolution was designed