Open nrabinowitz opened 9 years ago
I am trying to use mapsense.js npm.
Topojson and d3 are required with npm in the same file, but the console shows this error:
mapsense.js:1548 Uncaught ReferenceError: topojson is not defined
I think it's related to this issue.
The UMD wrapper is great for providing AMD support, but
topojson
andd3
are expected as globals. Unfortunately, both of those libraries also use a UMD wrapper, so if AMD support (i.e. RequireJS) is available, they will not be available as globals. So there's basically no way to use the library with RequireJS.I think the "right" way to fix this is to
define
a factory that takes the globals as arguments - see https://www.npmjs.com/package/umd-wrap for one approach.