Skip to content

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

Merged
onokumus merged 2 commits into
onokumus:masterfrom
BurkovBA:master
Feb 16, 2018
Merged

jQuery -> $ in src/metisMenu.js to fix import.#158
onokumus merged 2 commits into
onokumus:masterfrom
BurkovBA:master

Conversation

@BurkovBA

@BurkovBA BurkovBA commented Feb 15, 2018

Copy link
Copy Markdown
Contributor

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

BurkovBA commented Feb 16, 2018

Copy link
Copy Markdown
Contributor Author

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