Hi, Don't know if this will help you but I ran into similar problems when trying to use some plugins that depend on jQuery. What I think is you need to tell Webpack that there will be an alias 'jquery' so when other plugins refer to it, webpack knows where to grab it.
I solved it recently by adding to my webpack config file the following (I've shortened my webpack config just for what's important in this case):
var webpack = require("webpack");
var path = require("path");
module.exports = {
resolve: {
alias: {
// Force all modules to use the same jquery version.
'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery')
}
}
};
Then in your bootstrap.js file you require your plugins, I needed the bootstrap datetimepicker so this is what I needed to do:
window.$ = window.jQuery = require('jquery');
window.moment = require('moment');
require('bootstrap-sass');
require('datetimepicker');
I'm not a webpack power user yet so it took me couple of hours to get it working, but I did!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community