Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Builds not being cached with sveltejs and vite

$
0
0

I have a svelte project (not sveltekit) that is being built/bundled by vite.

The problem I am having is that the build times are growing unwieldly.Most of the time this project is being built without any changes to it (part of a bigger project), but it still builds for ~10 seconds, which makes me think that it is not doing any caching at all.

So my question is: is it possible to enable a build cache for vite?

And as a side thing:if I am building with the watch flag, each save triggers a full rebuild. Is it possible to only partially rebuild the code to speed things up?

my config currently looks like this

export default defineConfig({  resolve: {    alias: {"$lib": __dirname +"/src/svelte/lib","$logo": __dirname +"/src/LogoTool",    }  },  plugins: [svelte(), i18n()],  build: {    cssMinify: 'lightningcss',    rollupOptions: {      cache: true,      output: {        entryFileNames: `assets/[name].js`,        chunkFileNames: `assets/[name].js`,        assetFileNames: `assets/[name].[ext]`      }    },    lib: {      entry: "./src/svelte/main.ts",      formats: ["umd"],      name: "svelte"    },    minify: 'terser',    terserOptions: {      compress: true,      mangle: true,      keep_classnames: false,      ie8: false    },  },  publicDir: "assets",  server: {  }})

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>