-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi version doesn't work with tsconfig setting esModuleInterop=true #179
Comments
I'm pretty sure this is the underlying reason: oclif/config#44 the tsconfig isn't used by oclif at all for ts-node. Fixing it isn't trivial though. |
We are maintaining a CLI based on oclif in a TypeScript mono-repo. All packages have set Currently we have this workaround in place: --- a/node_modules/@oclif/config/lib/ts-node.js
+++ b/node_modules/@oclif/config/lib/ts-node.js
@@ -34,6 +34,7 @@ function registerTSNode(root) {
// cache: false,
// typeCheck: true,
compilerOptions: {
+ esModuleInterop: tsconfig.compilerOptions.esModuleInterop,
target: tsconfig.compilerOptions.target || 'es2017',
module: 'commonjs',
sourceMap: true, @jdxcode Would it make sense to add this behaviour to oclif by default? |
@mfellner I'd be happy with that patch |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I've created a new project:
Than I've updated tsconfig.json, I've added "esModuleInterop": true setting:
Than I updated hello.ts to check how it works if I import modules in esModuleInterop mode:
But it doesn't work:
For single cli
esModuleInterop=true
works fine, the problem only with multi version.Versions:
The text was updated successfully, but these errors were encountered: