I'm making a website in svelte using typescript and vite. However, when I make a mistake in one of the .Svelte files and get a runtime error in the browser, the error messages point to obfustacated code which makes it impossible to debug anything. With webpack I would tell the compiler to generate sourcemaps, but I can't seem to find a similar option in the vite configs. I have "dev:true" set in my vite configs and installed the svelte debugger browser extension.
CodePudding user response:
There is an option for that under build.sourcemap
, but your real issue is probably elsewhere because you should not see "obfuscated code" during development.
Maybe you are using Vite incorrectly, make sure to execute vite dev
during development.