Migration steps: - [x] `tsconfig.json` - [x] `compilerOptions.module` should be set to `node12` or `nodenext` (to enable top-level `async`/`await`) - [x] `package.json` - [x] All packages need to have `type` set to `module` - [ ] All packages should declare a correct `exports` property - [ ] All dependencies should be updated to their esm variants (with some caveats) - [x] `ts` files - [x] All relative imports should have file extensions (.js) - [x] all `require` statements should be removed in favor of `import()` or `require` via `createRequire` 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: - #1035 - #1158
Migration steps:
tsconfig.jsoncompilerOptions.moduleshould be set tonode12ornodenext(to enable top-levelasync/await)package.jsontypeset tomoduleexportspropertytsfilesrequirestatements should be removed in favor ofimport()orrequireviacreateRequireReference documentation:
Reference issues: