We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tsconfig, extends, workspaces, exports, subpath
ts-node should able to resolve if extends: points to the workspace package have subpath exports map.
extends:
// Some package uses config { "extends": "@test/tsconfig/tsconfig.json", }
//@test/tsconfig/package.json { "name": "@test/tsconfig", "version": "0.0.0", "license": "UNLICENSED", "private": true, "exports": { ".": "./tsconfig.base.json", "./tsconfig.json": "./tsconfig.base.json", "./tsconfig.cjs.json": "./tsconfig.cjs.json" } }
Not able to resolve modules.
https://github.com/kwonoj/wallaby-workspace-test
yarn // check plain ts-node behavior npx ts-node ./packages/pkg-core/src/index.ts // jest with ts-node yarn workspace @test/core run test-jest
See above
Related with #2091. In the PR, It sets conditions to undefined (https://github.com/TypeStrong/ts-node/pull/2091/files#diff-47fe05042c9c335713e6ad6b3933e31a4b4f870f0892d2614d28312b36e4b239R51) - which makes ts to set noderesolution feature to None (https://github.com/microsoft/TypeScript/blob/d701d908d534e68cfab24b6df15539014ac348a3/src/compiler/moduleNameResolver.ts#L1787).
undefined
None
This effectively disables all of node.js package.json's subpath exports (https://github.com/microsoft/TypeScript/blob/v5.7.2/src/compiler/moduleNameResolver.ts#L1685-L1689) either local (#imports) or exports. So if any package have exports / imports subpath map / alias, tsconfig extending it will fail to resolve module.
#imports
exports
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Search Terms
tsconfig, extends, workspaces, exports, subpath
Expected Behavior
ts-node should able to resolve if
extends:
points to the workspace package have subpath exports map.Actual Behavior
Not able to resolve modules.
Steps to reproduce the problem
https://github.com/kwonoj/wallaby-workspace-test
Minimal reproduction
See above
Description
Related with #2091. In the PR, It sets conditions to
undefined
(https://github.com/TypeStrong/ts-node/pull/2091/files#diff-47fe05042c9c335713e6ad6b3933e31a4b4f870f0892d2614d28312b36e4b239R51) - which makes ts to set noderesolution feature toNone
(https://github.com/microsoft/TypeScript/blob/d701d908d534e68cfab24b6df15539014ac348a3/src/compiler/moduleNameResolver.ts#L1787).This effectively disables all of node.js package.json's subpath exports (https://github.com/microsoft/TypeScript/blob/v5.7.2/src/compiler/moduleNameResolver.ts#L1685-L1689) either local (
#imports
) orexports
. So if any package have exports / imports subpath map / alias, tsconfig extending it will fail to resolve module.The text was updated successfully, but these errors were encountered: