I'm just starting to use Webpack, and I have an issue when I try to use jQuery with it. I'm a very newbie with Webpack, so please apologize if my question seems very basic.
Here is my webpack.config.js:
var webpack = require("webpack");
var path = require("path");
var bower_dir = __dirname + "/public/js/bower_components";
var compiled_dir = __dirname + "/public/js/compiled";
module.exports = {
entry: {
signup: compiled_dir + "/signup"
},
plugins: [
new webpack.ProvidePlugin({
$ : "jquery",
jQuery : "jquery",
"window.jQuery" : "jquery",
"root.jQuery" : "jquery"
})
],
resolve: {
alias: {
jquery : bower_dir + "/jquery/src/jquery",
}
},
output: {
path: path.join(__dirname, "public/js/dist"),
filename: "[name].bundle.js"
}
};
As I'm using ProvidePlugin (for jQuery plugins), I have no require("jquery") at the begininng of my file. However, at execution, I get this output on the console :
TypeError: jQuery.expr is undefined http://localhost:9000/js/dist/signup.bundle.js Line 6250
Do you have any clue ?
Thanks in advance.