jQuery via ProvidePlugin issue
See original GitHub issueHello, after this commit https://github.com/JeffreyWay/laravel-mix/commit/6e1ec3dcd4c3f4408c4ee119d70a1eb7ce6d450e I get error when compiling my assets.
The problem is that I do not use jquery but for example in Dropzone.js is this code.
if (typeof jQuery !== "undefined" && jQuery !== null) {
jQuery.fn.dropzone = function(options) {
return this.each(function() {
return new Dropzone(this, options);
});
};
}
so webpack require jquery but this ended with error.
Error:
Can't resolve 'jquery' in 'C:\xampp\htdocs\Moje\WEBSITES\VueShop\node_modules\dropzone\dist'
What about some provideJquery() function added to Laravel Mix for these who need this, or maybe there is other better solution.
Maybe is problem with Dropzone.js, how they determine if there is Jquery.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
ProvidePlugin not working with jquery - webpack
using thius set up i am unable to access my $ - jquery in console menu. enter image description here. any idea why...
Read more >ProvidePlugin - webpack
Whenever the identifier is encountered as free variable in a module, the module is loaded automatically and the identifier is filled with the...
Read more >jQuery via ProvidePlugin issue #96 - laravel-mix ... - GitHub
Hello, after this commit 6e1ec3d I get error when compiling my assets. The problem is that I do not use jquery but for...
Read more >JQuery in webpack.ProvidePlugin it doesn't work! - Vue Forum
Hi folk !! I am trying to establish JQuery in all my project through ProvidePlugin but it does not work, what I really...
Read more >$ is not defined - Jquery not found - Laracasts
In my Laravel project (laravel 5.6) I installed Jquery from npm. Then I added it to webpack.mix.js. ... I am using my custom...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I suggest using the following API:
Where the key is the node module and the value is an array of vars to reference it.
Thanks man