"Turbopack even knows to not compile source maps unless your Chrome DevTools are open" #5353
-
|
Hi, I'd like to know how do you detect that DevTools is open, all I found was an old post in Stack Overflow with 5 methods that don't work anymore. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
We don't do anything to detect that. We use an external map file in the So by using an external map file, a normal browser doesn't request the file and we don't do the work the assemble the map file. When you do open dev tools, it'll request the map file from the server, and when we receive that we'll finally assemble the map. |
Beta Was this translation helpful? Give feedback.
We don't do anything to detect that. We use an external map file in the
sourceMappingURLincluded in every JS file. Browsers won't download that file normally, unless you have the dev tools open.So by using an external map file, a normal browser doesn't request the file and we don't do the work the assemble the map file. When you do open dev tools, it'll request the map file from the server, and when we receive that we'll finally assemble the map.