gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

npm & webpack #398

Open laventnc opened 4 years ago

laventnc commented 4 years ago

Can't figure out how to get the npm package to work within a es6 module.

e.g.,

import 'jquery-ui/ui/widget';
import 'selectboxit/src/javascripts/jquery.selectBoxIt';
import 'selectboxit/src/stylesheets/jquery.selectBoxIt.css';

$.widget( 'qubit.selectBox', $.selectBox.selectBoxIt, {

} );

produces 'Cannot read property 'selectBoxIt' of undefined'

I'm also providing the jquery plugin to the module via:

plugins: [
    new webpack.ProvidePlugin( {
        $: 'jquery',
         jQuery: 'jquery',
         //'window.jQuery': 'jquery',
         //'global.jQuery': 'jquery',
         //"window.$": "jquery",
    } ),
],