New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESModule fix #318
ESModule fix #318
Conversation
@josh-hemphill apologies, work got a bit busy — I'll take a look at this tomorrow. I do believe, however, that there must a better way to leave out a conditional than replacing the #NO_GLOBAL? Some kind of variable injection? I'll look into this tomorrow. Thanks for the heads-up! |
Can we use Rollup's environment values flag instead of the replace? For example (untested):
and const excludeGlobal = process && process.env && process.env.EXCLUDE_GLOBAL;
if (window && !window.canvasDatagrid && !window.require && !excludeGlobal) {
window.canvasDatagrid = function (args) {
return new Grid(args);
};
} |
This is a good point: right now the tests are browser based (Karma), and support for ES modules in browsers isn't complete I believe. Right now I'd say don't worry about it — if the current Rollup config works, it works. But what we could do is add another, NodeJS-based test runner, to test just the ES module. We need to clean/split up some of the tests any way, so I'll see if I can add this in with that. |
I did some manual tests in the browser with the ES Module to be safe, it all seems to be good. |
Thanks, @josh-hemphill — I've merged this and the other changes and released it as v0.25.2. |
* Added ESModule Distribution * Fixed window property substitution * fixed ESModule code substitution * remove esFill * fix indentation * Removal of globals (use treeshaking) * Fixed build option, added comment * Replaced variable with string
Fixes ESModule Error in #317
Changes proposed in this pull request: