You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
esm.sh allows managing esm imports in import maps via it's cli
The Command
deno run -A -r https://esm.sh init
sets up the following scripts in deno.json:
"tasks": {
"esm:add": "deno run -A https://esm.sh/v129 add",
"esm:update": "deno run -A https://esm.sh/v129 update",
"esm:remove": "deno run -A https://esm.sh/v129 remove"
},
For example: Running deno task esm:add zod , results in a change in import_map.json of:
The fresh update script forces migration from an external import_map.json to "imports" inside deno.json/deno.jsonc
Possible Solutions
QuickFix: Publish a manual migration guide for each fresh version
This allows skipping the fresh update command altogether
Preferred solution: Make fresh upgrade script not force-migrate import_map.json
Why should fresh care at all, which import map solution is used?
For new projects, the inlined version can be used, but for existing projects it should simply keep the existing format
Another Solution: Make this import map migration configureable in the update script
CAUTION: This might introduce a lot of complexity, therefore I'd recommend only detecting the used variant (deno.json with imports or external import_map.json) and keep using the existing one.
The text was updated successfully, but these errors were encountered:
Description
esm.sh allows managing esm imports in import maps via it's cli
The Command
sets up the following scripts in deno.json:
For example: Running
deno task esm:add zod
, results in a change in import_map.json of:The basic problem
=> Open Issue: CLI assumes
import_map.json
even ifdeno.json
hasimports
esm-dev/esm.sh#687update
script forces migration from an external import_map.json to"imports"
inside deno.json/deno.jsoncPossible Solutions
QuickFix: Publish a manual migration guide for each fresh version
This allows skipping the fresh
update
command altogetherPreferred solution: Make fresh
upgrade
script not force-migrate import_map.jsonWhy should fresh care at all, which import map solution is used?
For new projects, the inlined version can be used, but for existing projects it should simply keep the existing format
Another Solution: Make this import map migration configureable in the
update
scriptCAUTION: This might introduce a lot of complexity, therefore I'd recommend only detecting the used variant (deno.json with imports or external import_map.json) and keep using the existing one.
The text was updated successfully, but these errors were encountered: