model-viewer
model-viewer copied to clipboard
allow three access
for the case when the page using model-viewer needs three to do some other job, since it is already bundled with model-viewer - it would be a shame to have to download three.js twice.
I see somebody have thought about it before but having official support for this would be nice.
Agreed! I just need to find the proper way to expose it and ensure the bundler doesn't tree-shake anything out. For this reason, I think we'll make a separate bundle for this, like model-viewer-three.min.js.
@makc Have you looked at #3948? The proposal is to distribute an additional mv package without three.js at all - then you would pull that in along with three using an import map along with whatever other code you need it for. Does that look like a workable solution for you?
@elalish that does sound reasonable, but then would you not have false bug reports in mv if the user imports incompatible three revision?
Yeah, but at least we aren't claiming to validate versions like with npm. I prefer no handrail to a handrail you can't trust. We'll just have to put it in the docs and remind people to post their versions in the issue template.
This happened as part of v3.2, try model-viewer-module.min.js, and follow the import map instructions at https://modelviewer.dev/examples/postprocessing/#setup