Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(js): set compilerOptions correctly when loading .ts that targets …
…ESM (nrwl#27862) When we load `.ts` files and the closest `package.json` specifies `"type": "module"`, then the file may error upon loading. This happens because we're not setting `compilerOptions` correctly when registering `ts-node/esm`-- in fact there is no way to pass options through this hook. This PR sets defaults on `TS_NODE_COMPILER_OPTIONS` such that the `module` and `moduleResolution` are correct values for ESM. It also works for CJS since both `module` and `moduleResolution` check the closest `package.json` to determine the format. ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes nrwl#23228
- Loading branch information