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 flag to skip source-map-support install() #1533

Open
cspotcode opened this issue Oct 27, 2021 · 2 comments
Open

Add flag to skip source-map-support install() #1533

cspotcode opened this issue Oct 27, 2021 · 2 comments
Labels
you can do this Good candidate for a pull request.

Comments

@cspotcode
Copy link
Collaborator

Related:
#796
#1473
cspotcode/node-source-map-support#23

Add a configuration option, perhaps named installSourceMapSupport or sourceMapHooks, which can be used to disable require('@cspotcode/source-map-support').install()

Important things to consider:

  • Do we continue to generate sourcemaps when compiling? Probably the best answer is "yes" to be compatible with node's built-in --enable-source-maps
    • Maybe we should obey the user's tsconfig? If they have sourcemaps turned on/off in tsconfig, then we do/don't generate sourcemaps?
  • Clearly document default behavior:
    • with --enable-source-maps enabled, default is "off"
    • without --enable-source-maps, default is "on"
    • When set to true or false via config, overrides the default
@pe8ter
Copy link

pe8ter commented Oct 28, 2021

Just confirming my understanding: This new option will be configurable within a tsconfig.json as well? I ask because in some scenarios we have no control over how a library invokes ts-node. As an example, Karma automatically invokes ts-node when a Karma config is written in TypeScript. Since I can't control how it invokes ts-node, it would be nice if I could throw this new flag into my tsconfig.json and have Karma pick up the flag automatically.

It's in the README.

@krigga
Copy link

krigga commented May 1, 2023

@cspotcode is this #2004 a good entry point for this, disregarding docs and the node's own --enable-source-maps? If so, what would be a good place to document the full behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

3 participants