Skip to content

Consider modern moduleResolution #4623

@swiing

Description

@swiing

The typescript config sets moduleResolution to value node. This issue comments on this setting, and suggests the primer team could revise it (e.g. change to Bundler value?)

From typescript handbook

node10: Formerly known as node, this is the unfortunate default when module is set to commonjs. It’s a pretty good model of Node.js versions older than v12, and sometimes it’s a passable approximation of how most bundlers do module resolution. [...]
Because Node.js v12 introduced different module resolution rules for ES modules, though, it’s a very bad model of modern versions of Node.js. It should not be used for new projects.

Hence, the node value seems kindof outdated.

From package.json

engine.node >= v12

Hence; the node value seems a mismatch

From PR #4054

@joshblack introduces the PR with a changelog, including:

Set moduleResolution to Bundler

However, the #4054 does not actually introduce this change. Was it the intention, but forgotten?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions