Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review module and moduleResolution behaviour #1483

Open
72636c opened this issue Mar 20, 2024 · 0 comments
Open

Review module and moduleResolution behaviour #1483

72636c opened this issue Mar 20, 2024 · 0 comments

Comments

@72636c
Copy link
Member

72636c commented Mar 20, 2024

Our base config currently sets moduleResolution to node:

"moduleResolution": "node",

Per https://www.typescriptlang.org/docs/handbook/modules/reference.html#node10-formerly-known-as-node

--moduleResolution node was renamed to node10 (keeping node as an alias for backward compatibility) in TypeScript 5.0. It reflects the CommonJS module resolution algorithm as it existed in Node.js versions earlier than v12. It should no longer be used.


skuba build-package currently hardcodes modules:

{
command:
'tsc --module CommonJS --outDir lib-commonjs --project tsconfig.build.json',
name: 'commonjs',
prefixColor: 'green',
},
{
command:
'tsc --module ES2015 --outDir lib-es2015 --project tsconfig.build.json',
name: 'es2015',
prefixColor: 'yellow',
},

Per https://www.typescriptlang.org/docs/handbook/modules/reference.html#commonjs:

You probably shouldn’t use this [commonjs]. Use node16 or nodenext to emit CommonJS modules for Node.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant