Update Vite configuration and Character3D component for improved module handling
- Added 'three' to the dedupe array in Vite config to optimize dependency resolution. - Updated CommonJS options to enable transformation of mixed ES modules for better compatibility. - Changed the import path for GLTFLoader in Character3D.vue to align with the latest Three.js structure.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { markRaw } from 'vue';
|
import { markRaw } from 'vue';
|
||||||
import * as THREE from 'three';
|
import * as THREE from 'three';
|
||||||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Character3D',
|
name: 'Character3D',
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
stream: 'stream-browserify',
|
stream: 'stream-browserify',
|
||||||
util: 'util',
|
util: 'util',
|
||||||
assert: 'assert',
|
assert: 'assert',
|
||||||
}
|
},
|
||||||
|
dedupe: ['three']
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
@@ -59,7 +60,8 @@ export default defineConfig(({ mode }) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
commonjsOptions: {
|
commonjsOptions: {
|
||||||
include: [/three/, /node_modules/]
|
include: [/three/, /node_modules/],
|
||||||
|
transformMixedEsModules: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user