Skip to content

Commit

Permalink
Run ts-node with esm loader
Browse files Browse the repository at this point in the history
This fixes the issue where we are unable to run packages
that only export ES Modules. It's possible we will still run into some
issues with this configuration since ESM support is still experimental
on the TypeScript side.

Relevant issue: TypeStrong/ts-node#1007
ESM loader docs: https://typestrong.org/ts-node/docs/imports/#native-ecmascript-modules
  • Loading branch information
stevehanson committed May 12, 2023
1 parent 5ed7cff commit 436ac83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "Monorepo for project bootstrapping CLIs",
"main": "index.js",
"type": "module",
"scripts": {
"belt": "bin/belt",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
6 changes: 5 additions & 1 deletion tsconfig.json
Expand Up @@ -2,13 +2,17 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"target": "es2019",
"module": "commonjs",
"module": "ES2020",
"moduleResolution": "node",
"strict": true,
"sourceMap": true,
"outDir": "./build",
"skipLibCheck": true,
"types": ["node"]
},
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
},
"include": ["./**/*"]
}

0 comments on commit 436ac83

Please sign in to comment.