Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a minified all-inclusive ES6 module build #2530
I've tried using cytoscape.js as an ES6 module from unpkg.com as follows:
<!doctype html> <html><body><script type="module"> import cy from 'https://firstname.lastname@example.org/dist/cytoscape.esm.js?module'; </script></body></html>
This didn't work because, as unpkg.com puts it,
Apparently, the esm build is not for direct (bundler-less) consumption by an ES6
I'd therefore kindly ask you to include such a build alongside the min one, so that folks can use either the old
or the ES6
import cy from '[CDN]/dist/cytoscape.mes.js';
way of including cytoscape.js.
This PR adds such a build target and calls it
BTW, could someone point me towards the purpose of that esm build compared to, say, the umd build? It seems to me that at least webpack is completely oblivious to the ES6-ness of an
If we expose the esm build as the
Until webpack fixes this issue we can't support
You have to configure webpack to alias
Of course! I'd only thought of
I've also supplemented the documentation a bit, but I'm not quite sure if it's okay to feature the ES6 module so prominently.
Thank you very much for the explanation, now I understand why you bother with a separate esm build.
Node apparently will consider all
I think I found a compromise. There is an ES6 module-version of