Currently, the Preact CDN transformation only works for preact and preact/hooks. I also see that this is because they are hardcoded as the only things to lookup.
Unfortunately the way the fallback substitution is done breaks other preact submodules (e.g. preact/compat). It tries to load $PINNED_PREACT_URL.js/compat, which is invalid.
My specific issue is with preact/compat, so this could be solved easily just by adding another hardcoded entry to PREACT_CDN_LOOKUP, but it might be worthwhile to not hardcode the import paths and resolve them as they come up.
Currently, the Preact CDN transformation only works for
preact
andpreact/hooks
. I also see that this is because they are hardcoded as the only things to lookup.Unfortunately the way the fallback substitution is done breaks other preact submodules (e.g.
preact/compat
). It tries to load$PINNED_PREACT_URL.js/compat
, which is invalid.My specific issue is with
preact/compat
, so this could be solved easily just by adding another hardcoded entry toPREACT_CDN_LOOKUP
, but it might be worthwhile to not hardcode the import paths and resolve them as they come up.