From 3d5342b3147df42d06e20efe944e1332e4baf929 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 22 Jan 2026 12:24:57 +0100 Subject: [PATCH] Update Vite configuration to enhance dependency optimization and build settings - Added 'three' and its GLTFLoader to the optimizeDeps include array for improved module resolution. - Introduced custom Rollup options to prevent externalization of the 'three' library during the build process. - Configured CommonJS options to include 'three' and node_modules for better compatibility with dependencies. --- frontend/vite.config.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 37c59c6..42bb3f9 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -33,15 +33,16 @@ export default defineConfig(({ mode }) => { }) }, optimizeDeps: { - esbuildOptions: { - plugins: [ - NodeGlobalsPolyfillPlugin({ - buffer: true - }), - NodeModulesPolyfillPlugin() - ] - } - }, + include: ['three', 'three/examples/jsm/loaders/GLTFLoader.js'], + esbuildOptions: { + plugins: [ + NodeGlobalsPolyfillPlugin({ + buffer: true + }), + NodeModulesPolyfillPlugin() + ] + } + }, resolve: { alias: { '@': path.resolve(__dirname, './src'), @@ -50,5 +51,16 @@ export default defineConfig(({ mode }) => { assert: 'assert', } }, + build: { + rollupOptions: { + output: { + // Stelle sicher, dass three nicht externalisiert wird + manualChunks: undefined + } + }, + commonjsOptions: { + include: [/three/, /node_modules/] + } + }, }; });