sambacha / typescript-cjs-esm-tests

ESM/CJS docs + testing & dist for cjs/esm - Establishing the best way to support cjs and esm and how to structure project to enable that
9 stars 3 forks source link

Top level await expressions #10

Open sambacha opened 2 years ago

sambacha commented 2 years ago

Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.ts(1378)

sambacha commented 2 years ago
- import JSBI from 'jsbi';
- import { JSBI } from 'jsbi';
- const JSBI = require('jsbi');
+ const { JSBI } = await import('JSBI');
- type JSBI = import('jsbi').JSBI