-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Migration steps:
-
tsconfig.json
-
compilerOptions.module
should be set tonode12
ornodenext
(to enable top-levelasync
/await
)
-
-
package.json
- All packages need to have
type
set tomodule
- All packages should declare a correct
exports
property - All dependencies should be updated to their esm variants (with some caveats)
- All packages need to have
-
ts
files- All relative imports should have file extensions (.js)
- all
require
statements should be removed in favor ofimport()
orrequire
viacreateRequire
Reference documentation:
- https://2ality.com/2021/06/typescript-esm-nodejs.html
- https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#ecmascript-module-support-in-node-js
Reference issues: