You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I use webpack (laravel-mix wrapper) for build css and js files.
All css I put in <head>section and all js I put before </body> section.
It worked well in different projects but on my last project some of plugins not working properly: Google maps, reCAPTCHA. Errors about jQuery in console (with Debugger enabled all works fine because it uses own jQuery).
//commented because I load jQuery with Grav assets//window.$ = window.jQuery = require('jquery');require('bootstrap-sass');require('slick-carousel');require('lightgallery');require('lg-thumbnail');window.Noty=require('noty');
Hello!
In my project I use webpack (
laravel-mix
wrapper) for build css and js files.All css I put in
<head>
section and all js I put before</body>
section.It worked well in different projects but on my last project some of plugins not working properly: Google maps, reCAPTCHA. Errors about jQuery in console (with Debugger enabled all works fine because it uses own jQuery).
I found this issue about my captcha problem: getgrav/grav-plugin-form#238
and rhuk solution getgrav/grav-plugin-form#238 (comment) to put jquery in head and other js in bottom like I did before.
My
vendor.js
file:Part of my
custom.js
file:My
app.js
file:Part of my
head.html.twig
:Part of my
base.html.twig
:Maps with Captcha becomes working. But I get an error:
After trying to get rid of it I did this workaround (and disable js require
slick-carousel
):Ok, now
slick-slider
works fine, but another error withlightGallery
js library:As a workaround I can enable this line back
window.$ = window.jQuery = require('jquery');
. All works but I have jQuery 2.x and jQuery 3.x in one page.How to make Grav and webpack assets to work together?
The text was updated successfully, but these errors were encountered: