google-ar / three.ar.js

A helper three.js library for building AR web experiences that run in WebARonARKit and WebARonARCore
https://developers.google.com/ar/develop/web/getting-started
Apache License 2.0
2.91k stars 365 forks source link

Proper exporting when using rollup #63

Closed jsantell closed 6 years ago

jsantell commented 6 years ago

When using rollup and consuming three.ar.js as a dependency, we encounter the named export error reported by rollup with a workaround.

[!] Error: 'ARUtils' is not exported by node_modules/three.ar.js/dist/three.ar.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module

`import { ARUtils, ARView, ARPerspectiveCamera } from 'three.ar.js';`

We should fix this on our end for the umd-style build that we have currently, and may include also having an es6 module distributable for this purpose.

jsantell commented 6 years ago

This might just be what happens when consuming UMD -- publishing a module format (and package.json module entry) would solve this, I think

jsantell commented 6 years ago

Fixed in #89