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

jQuery -> $ in src/metisMenu.js to fix import. #158

Merged
merged 2 commits into from
Feb 16, 2018

Conversation

BurkovBA
Copy link
Contributor

@BurkovBA BurkovBA commented Feb 15, 2018

First line of import.js imports jQuery as $. Accordingly, under $ name it should be visible to the rest of the module.

Thus, I replaced global jQuery in MetisMenu and Util with $ in constructor invocations and now metismenu will be successfully executed in node.js environment.

@BurkovBA
Copy link
Contributor Author

BurkovBA commented Feb 16, 2018

Update: my previous built would've been broken in browser environment.

It required addition of babel-plugin-transform-es2015-modules-umd to fix renaming of global.jquery to global.jQuery in browser environment.Solution was suggested here: https://stackoverflow.com/questions/48818400/how-to-transpile-ecma6-import-of-jquery-to-a-umd-wrapper-with-babel/48824565#48824565

I didn't run an extensive testing so far though.

UPDATE: tested in browser with Webpack build - works fine now.

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

Successfully merging this pull request may close these issues.

2 participants