feat: Add deps.includeSourcemap#7095
Conversation
This option allows to control if inline source maps should be included in dependencies. This is useful when debugging inline dependencies fixes vitest-dev#5605
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
I don't believe this PR will be necessary once vitejs/vite#19004 is merged. The problem was upstream (in Vite), where the SSR transform was not preserving the line offset of the original code. When the line offset is preserved, you don't need a sourcemap, since the SSR transform doesn't indent anything (which means the column offset is unaffected). |
|
You're probably right @aleclarson! Thanks for looking into it. I'll keep this PR open (as a draft) just in case for some reason yours won't be merged or for some reason won't fix #5605 :) |
|
Hey @bgoscinski, to be clear, my Vite PR absolutely fixes #5605. I tested with your reproduction 😄 |
|
Oh perfect! I'll take your word for it then :) |
This option allows to control if inline source maps should be included in dependencies. This is useful when debugging inline dependencies. It was discussed in #6041 (comment)
To get correct line numbers you need to specify dependencies you wish to debug in
deps.includeSourcemapand configureoutFilesin.vscode/launch.jsonlike this:{ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", // ... "outFiles": [ "${workspaceFolder}/**/*.(m|c|)js", "!**/node_modules/**", + "${workspaceFolder}/node_modules/**/date-fns/**/*.js" ] } ] }fixes #5605
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.