Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

ES Module (ESM) version of threebox #75

Open
danvk opened this issue Oct 2, 2019 · 3 comments
Open

ES Module (ESM) version of threebox #75

danvk opened this issue Oct 2, 2019 · 3 comments

Comments

@danvk
Copy link

danvk commented Oct 2, 2019

As of r106 ES modules are the preferred way to use THREE.js. I'd like to import THREE.js in my own code as an ES module, but threebox uses its own bundled version of three.js, which I imagine will cause issues.

It would be great if threebox used the ESM version of THREE.js rather than bundling its own. Or, alternatively, gave the user some way to bring your own THREE.js.

@peterpolman
Copy link

There is a way to change the baked in three.js version; Try to replace the ./src/three.js file with a version of your choice and run the build command as defined in ./package.json.

npm run build

This will compile a new minified threebox file containing your specified three.js version. You can require this in your app. Beware for conflicts when you upgrade three.js in threebox, the threebox code might not be ready for the latest three.js changes:)

@danvk
Copy link
Author

danvk commented Oct 3, 2019

That's not usually how dependencies are handled with NPM :) It would be better if threebox declared its dependency on three.js, rather than bundling it. This would let my app and threebox share a common version.

@peterpolman
Copy link

peterpolman commented Oct 4, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants