Change tsconfig/json
moduleResolution
to bundler
#9007
Labels
Milestone
tsconfig/json
moduleResolution
to bundler
#9007
Describe the problem
To reiterate this issue: In TypeScript 4.7, along the property "module": "node16" that enables ESM features in TypeScript, there are new values for the property "moduleResolution": "node16" and "nodenext". Both values allows importing from dependencies with package.json exports, imports, and self-referencing.
Right now, this property in the default
.sveltekit/tsconfig.json
is "node." This doesn't support features like defining "types" in "exports".Describe the proposed solution
Change
tsconfig/json
moduleResolution
tonode16
ornodenext
. This will mean that relative import paths need explicit file extensions - so'./$types.js';
instead of'./$types';
, and similar changes. It'd be a breaking change, atleast for typescript linting, but seems to be more future proof.Alternatives considered
Keep
moduleResolution
asnode
. It's less future proof, as we'll keep having to usedeclare module
and a globaltypes
property inpackage.json
.Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: