Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable minification when running "build" command in sveltekit?

I am deploying sveltekit to a dfinity container and I need to disable minification to debug.

I have to build a static version to deploy it with npm run build -- is there a vite option to disable minification?

I've tried this: svelte.config.js but it doesn't do anything:

vite: {
    resolve: {
        alias: {
            $components: path.resolve('./src/components'),
            $stores: path.resolve('./src/stores'),
            $api: path.resolve('./src/api')
        }
    },
    build: {
        minify: false
    }
}
like image 399
chovy Avatar asked Dec 07 '25 08:12

chovy


1 Answers

Use vite.config.js/ts instead, and set the build.minify option:

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

export default defineConfig({
    plugins: [sveltekit()],
    build: {
        minify: false
    }
});

Reference

like image 134
ciscoheat Avatar answered Dec 10 '25 02:12

ciscoheat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!