Skip to content
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

Support ES6 loading #139

Open
jurchiks opened this issue Nov 10, 2021 · 0 comments
Open

Support ES6 loading #139

jurchiks opened this issue Nov 10, 2021 · 0 comments

Comments

@jurchiks
Copy link

jurchiks commented Nov 10, 2021

Currently it is impossible to load this plugin when building sources using, e.g. gulp, because import 'modaal' fails with Uncaught ReferenceError: jQuery is undefined, even if you have code like this:

import $ from 'jquery'; <-- This does not define window.jQuery when building code in Node.
import 'modaal'; <-- This subsequently does not have access to a global jQuery object.

I've found a pretty nice workaround for this, but it requires changes in your source code, there's nothing I can do in my code to make it work: https://gist.github.com/monkeymonk/c08cb040431f89f99928132ca221d647
This can obviously be merged into a single JS file, the gist is simply a flexible solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant