Commit e4bd9c2
committed
Transpile module syntax into CJS in dev
`src/index.ts` is designed to be run as an executable, and we want to be
able to run this in tests via `ts-node`. However, `ts-node` does not run
a TypeScript file when `tsconfig.json` specifies anything other than
"CommonJS" for the `module` setting ([unless you configure `ts-node`
and/or Node specially][1]). This commit instructs TypeScript to rewrite
imports using the CommonJS syntax only in the default TypeScript config
(ES6 is still used when `yarn build` is run).
[1]: https://typestrong.org/ts-node/docs/imports/1 parent de19413 commit e4bd9c2
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments