-
-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add moduleType option to override module type on certain files. (#1371)
* Add moduleType option to override module type on certain files. Also refactor resolverFunctions into their own file; should break this into 2x PRs later. * lint fix * add test * remove unnecessary exports from ts-internals; mark exports as @internal * add docs * strip optionBasePaths from showConfig output * proper path normalization to support windows * lint-fix * use es2015 instead of es2020 in test tsconfig to support ts2.7 * add missing path normalization when calling classifyModule * Test coverage: moduleType overrides during ts-node loader usage (#1376) * Test coverage: add test case to confirm that moduleType overrides are applied for ts-node in loader mode * Ensure that a default export exists for the esm-exception module * Re-order tsconfig.json glob rules, and use implicit globbing * lint fixup: apply prettier * Add 'experimental-specifier-resolution' flag to NPM options in ESM module override test * Ensure that a default export exists for the cjs-subdir module * Revert "Ensure that a default export exists for the cjs-subdir module" This reverts commit c64cf92. * Revert "Add 'experimental-specifier-resolution' flag to NPM options in ESM module override test" This reverts commit 1093df8. * Specify tsconfig project using TS_NODE_PROJECT environment variable * Use full file paths in preference to directory-default module imports This avoids ERR_UNSUPPORTED_DIR_IMPORT, without having to provide the 'experimental-specifier-resolution' flag to ts-node * Update index.ts * Update index.ts * Update tsconfig.json * Extract execModuleTypeOverride function * Add expected failure cases for Node 12.15, 14.13 Co-authored-by: Andrew Bradley <[email protected]> * Update tests * fix * fix * fix for TS2.7 * fix * fix * reword * update docs * address todos * fix Co-authored-by: James Addison <[email protected]>
- Loading branch information
1 parent
4e7fcb7
commit 1bc470d
Showing
28 changed files
with
980 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.