Reply To: Import in webpack

Home Forums Latest release 1.1.x Import in webpack Reply To: Import in webpack

#9163
admin
Keymaster

Hi, you need both jquery and smartmenus added to your dependencies in “package.json” – e.g.:

"jquery": "^3.3.1",
"smartmenus": "^1.1.1"

and then in your app’s JS the following should work:

import $ from 'jquery';
require('smartmenus');

...

$('#main-menu').smartmenus();

The smartmenus module exports jQuery itself so you could even do something like this (without importing jquery separately):

import $ from 'smartmenus';

...

$('#main-menu').smartmenus();

Register

You will be emailed a link to set your password.

Login

Lost password?