Incremental build

Hey guys, is there a way to “incrementally” production-build the vite project and skip the asset compression (and possibly other steps but mainly asset compression)?

Hi krizzl0r,

By design the full production build in Vite (and thus in our Needle Engine projects) runs all asset optimizations—compression, texture conversions, etc.—to keep your final website as optimized as possible. There isn’t an out‑of‑the‑box “incremental” production build mode that skips these steps. However, if you’re looking for a faster build cycle in development and want to skip asset compression (or other compression steps), you have a couple of options:

‱ In your vite.config.js file you can conditionally disable the compression plugin (typically provided by vite‑plugin‑compression). For example, you could remove or comment out the plugin line so it won’t run during your build:


js
import { defineConfig } from ‘vite’;
import react from ‘@vitejs/plugin-react’;
import basicSsl from ‘@vitejs/plugin-basic-ssl’;
// import viteCompression from ‘vite-plugin-compression’; // disable asset compression

export default defineConfig({
plugins: [
react(),
basicSsl(),
// Remove or conditionally include: viteCompression({ deleteOriginFile: true })
],
build: {
// Your build options
}
});

This way, when you run “vite build” the asset compression step will be skipped.

‱ Alternatively, if you’re using the Needle Engine export process (for example via Unity), note that the development build option already omits certain compression steps like KTX2 and Draco compression as described in our deployment docs. This can act as a kind of “incremental” build that’s faster but not as optimized for final deployment.

Keep in mind that skipping these steps means the built files might be larger and load slower in the final deployment. If your main concern is build speed while iterating, using a development build or temporarily disabling the compression plugin is a common workaround.

Hope that helps! Let me know if you have any further questions.

1 replies left - Become PRO for more replies.
thread_XB9pztCZjkDsYvyL4XJw36I8
Reply to this post directly if you need further help (bottom right button)

Could you tell us a bit more about what issue you’re trying to work around? Compression is already designed to be incremental – already compressed assets will not be recompressed, and compressed data is loaded from a cache.

I’m trying to get faster builds for quick iterations (currently hunting a non-needle related bug) where I know I did not touch any assets. You’re right of course in that everything is cached but checking the cache still takes about ~40% of my build time.

For local development or deployment?

For local development and preview in your localhost server: turn off AutoCompress in the Needel Engine component