Using three.js based library in vite/Rollup - "Multiple instances of three.js being imported"

In that case, unless you still need to package the library separately - using peerDependencies in a project with more than a single directory will not do much.

If you plan on having that library as a separate bundle, to test locally you have to put it in a separate directory, with a separate package.json, npm pack it, and then npm install it in the main project. Otherwise you’re doubling dependencies.

3 Likes