-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 source maps to node loader #2458
Conversation
This allows people to debug MDX files when using the Node.js loader.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How would people use this? What has a VS Code debugger to do with running Can we detect if some source maps flag is passed to Node? Then it can work the same as Rollup: auto-add a You can change the test script in the Or, can this be default behavior? |
People use this by debugging a script that imports MDX. For example by specifying the I was using
I like this idea. Given the following script: import inspector from 'node:inspector'
console.dir(process.sourceMapsEnabled)
console.dir(process.execArgv)
console.dir(inspector.url()) Running with
Running from the VSCode JavaScript Debug Terminal yields:
Note that
👍
You mean always pass |
Wait, does that mean that auto-detecting this would not work with your debugger? 🤔 Or do you mean to enable this feature when either
Perhaps we should spawn different Node processes in the tests btw. That way we can properly test whether (in the future, different) flags are passed?
Yeah, that’s the only potential downside, right? |
It basically means there are two distinct features that benefit from source maps.
Yes, even better.
Yes, that’s the only potential downside. I’m fine with adding Two more things I noticed:
|
Are you planning to continue working on this, or were you waiting for a response from me? |
Just this question: Should we always pass |
Yeah 👍 |
There’s not really a reason not to.
Are you looking into the Windows failure? Also, the different spawned threads? (“Perhaps we should spawn different Node processes in the tests btw.”) |
Ugh, Windows path separators must be one of the most expensive mistakes in the history of software.
This was useful to test detect whether source maps are useful as discussed earlier. Since we now just always enable source map generation, we no longer have to test this detection. |
Initial checklist
Description of changes
This allows people to debug MDX files when using the Node.js loader. I confirmed this works using the VSCode debugger. I’m not sure how to test this properly.