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.
This commit is contained in:
Torsten Schulz (local)
2026-01-22 12:24:57 +01:00
parent 78d43e6859
commit 3d5342b314

View File

@@ -33,6 +33,7 @@ export default defineConfig(({ mode }) => {
}) })
}, },
optimizeDeps: { optimizeDeps: {
include: ['three', 'three/examples/jsm/loaders/GLTFLoader.js'],
esbuildOptions: { esbuildOptions: {
plugins: [ plugins: [
NodeGlobalsPolyfillPlugin({ NodeGlobalsPolyfillPlugin({
@@ -50,5 +51,16 @@ export default defineConfig(({ mode }) => {
assert: 'assert', assert: 'assert',
} }
}, },
build: {
rollupOptions: {
output: {
// Stelle sicher, dass three nicht externalisiert wird
manualChunks: undefined
}
},
commonjsOptions: {
include: [/three/, /node_modules/]
}
},
}; };
}); });