Skip to content
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

Add installSourceMapSupport configuration option #2004

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ function filterRecognizedTsConfigTsNodeOptions(jsonObject: any): {
esm,
experimentalSpecifierResolution,
experimentalTsImportSpecifiers,
installSourceMapSupport,
...unrecognized
} = jsonObject as TsConfigOptions;
const filteredTsConfigOptions = {
Expand Down Expand Up @@ -433,6 +434,7 @@ function filterRecognizedTsConfigTsNodeOptions(jsonObject: any): {
esm,
experimentalSpecifierResolution,
experimentalTsImportSpecifiers,
installSourceMapSupport,
};
// Use the typechecker to make sure this implementation has the correct set of properties
const catchExtraneousProps: keyof TsConfigOptions =
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ export interface RegisterOptions extends CreateOptions {
* For details, see https://github.com/TypeStrong/ts-node/issues/1514
*/
experimentalResolver?: boolean;

installSourceMapSupport?: boolean;
}

export type ExperimentalSpecifierResolution = 'node' | 'explicit';
Expand Down Expand Up @@ -582,7 +584,9 @@ export function register(

installCommonjsResolveHooksIfNecessary(service);

service.installSourceMapSupport();
if (service.options.installSourceMapSupport ?? true) {
service.installSourceMapSupport();
}

// Require specified modules before start-up.
(Module as ModuleConstructorWithInternals)._preloadModules(
Expand Down