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:
@@ -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/]
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user