Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are sourcempas located and how do I generate them in Sveltekit?

I cannot find them anywhere, I don't even see that they are being created when I run npm run build. I am using the latest version of sveltekit with typescript. I would assume the sourcemaps would be located in the output folder of the .svelte-kit directory but no dice.

// svelte.config.js
...
const config = {
   compilerOptions: {
      enableSourcemap: true
   },
   preprocess: [
      preprocess({
         postcss: true,
         sourceMap: true
      })
   ],
   kit: {
      adapter: vercel(),
      methodOverride: {
         allowed: ['PATCH', 'DELETE']
      },
   }
};

export default config;

I also have sourceMap: true under the compilerOptions of my tsconfig.json

like image 407
Craig Howell Avatar asked Oct 26 '25 09:10

Craig Howell


1 Answers

I use SvelteKit 1.0.0-next.350 with adapter-node and npm run build puts result files to <project root>/build directory, not to <project root>/.svelte-kit. It is because the build out dir for adapter-node is set in the adapter.

Try to check the adapter you are actually using. Maybe the out dir for adapter-vercel is <project root>/.vercel_build_output or <project root>/.vercel/output?

Also you can try to enable this sourcemap option:

export default {
    kit: {
        vite: {
            build: {
                sourcemap: true
            }
        }
    }
}
like image 187
Mihail H. Avatar answered Oct 29 '25 09:10

Mihail H.