I'm trying to use bootstrap-daterangepicker with Webpack. In my view file I have the following:
define(function (require) {
require('bootstrap-daterangepicker');
$('#daterangepicker').daterangepicker({ ... });
});
And in webpack.config.js
:
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
]
This results in daterangepicker is not a function
. I've taken a look at daterangepicker.js
, and it seems that $.fn.daterangepicker
is not exported correctly. How would I do this? I've tried using imports-loader
to force import jQuery, but that didn't help.