Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Import in webpack

Home Forums Latest release 1.1.x Import in webpack

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9162
    kenfranklin
    Participant

    How to import in Webpack
    import smartmenus from ‘smartmenus’ not working

    #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();
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘1.1.x’ is closed to new topics and replies.