1

I have the following...

//vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

export default defineConfig({
    plugins: [sveltekit()],
    build: {
        sourcemap: true
    }
});
// svelte.config.js
import adapter from '@sveltejs/adapter-static';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    kit: {
        // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
        // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
        // See https://svelte.dev/docs/kit/adapters for more information about adapters.
        adapter: adapter({
            // default options are shown. On some platforms
            // these options are set automatically — see below
            pages: '../app/src/main/resources/static',
            assets: '../app/src/main/resources/static',
            fallback: null,
            precompress: false,
            strict: true
        })
    },
    compilerOptions: {
        sourcemap: true
    }
};

export default config;

However, when I run I do not see the sourcemaps being outputed when I run npm run build.

This question is not the same problem as you can see I have that property set. My guess is it is related to me using the resource-static.

How can I generate sourcemaps with the resource-static kit.

3
  • I created a similar SSG SvelteKit project and set the same sourcemap options in Vite's and SvelteKit's configs. Vite's config can either be true, false, 'inline' or 'hidden'. Svelte's config can either be a sourcemap?: object | string; per the documentation. This parameter should be "An initial sourcemap that will be merged into the final output sourcemap. This is usually the preprocessor sourcemap." Maybe the parameter needs to be provided a template sitemap.xml? If that doesn't work I also found svelte-sitemap. Commented Jan 8 at 19:49
  • Did the library generate it the way you wanted? I wonder if something like this would work github.com/bartholomej/… Commented Jan 8 at 22:20
  • Oh that is a sitemap but yeah that lib is great I am looking for a SOURCEmap Commented Jan 8 at 22:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.