I have created multiple projects in threejs, today I had to use two projects in the same page and is not working the build threejs libraries are conflicting with each other.
Is there a way around for this, I can’t add just one instance of threejs… I tried to rename it using vite but no luck…
This is what I tried in VITE it does change the name but is not enough there are still conflicts
import glsl from ‘vite-plugin-glsl’;
import { defineConfig } from ‘vite’;
import mkcert from ‘vite-plugin-mkcert’;
import replace from ‘@rollup/plugin-replace’;
export default defineConfig({
build: {
outDir: ‘build’,
assetsDir: ‘src’,
emptyOutDir: true,
chunkSizeWarningLimit: 2024,
minify: false,
rollupOptions: {
output: {
entryFileNames: “src/FWDFUB.js”,
}
},
},
server: {
host: ‘bs-local.com’,
port: 5173,
https: true,
},
plugins: [
glsl(),
mkcert(),
replace({
preventAssignment: true,
values: {
‘import * as THREE from “three”;’: ‘import * as FWDUFB_THREE from “three”;’,
‘THREE.’: ‘FWDUFB_THREE.’,
},
}),
],
});