Closed ngokevin closed 8 years ago
I feel like I'm missing something on npmcdn
.. With the default https://npmcdn.com/aframe-extras, or if I force it to https://npmcdn.com/aframe-extras/browser.js, it doesn't roll up the dependencies.. But if I try https://npmcdn.com/aframe-extras/dist/aframe-extras.js nothing is found. How does this work?
Oh, sorry didn't see. It doesn't find anything because it only has access to what is deployed on npm
. Because the dists aren't currently being published, it won't find anything.
@ngokevin Hm, this doesn't seem feasible. The browser
field is used by bundlers like Browserify too, at higher precedence than main
, so if I set it to a minified build Browserify breaks. That appears to be intended behavior: https://github.com/defunctzombie/package-browser-field-spec
To do something like this, I think we'd probably need an A-Frame convention for special fields in package.json
, or a convention for always naming output dist/npmcdn.min.js
the same way.
I was able to tell Browserify to ignore it: https://github.com/ngokevin/aframe-component-boilerplate/blob/master/package.json#L9
Nice, but still what if someone wants to do npm install --save aframe aframe-extras
? Can't really justify the change if it means broken or nonstandard Browserify/Webpack support.
Would like to be able to use with
npmcdn
. You can set a browser field in package.json to point to your browser build. Currently, pointing to the index. https://npmcdn.com/aframe-extras@2.2.0