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
With Vite, it seems that a different code path gets hit, and the import returns a function that we need to call to bind justifiedGallery with jquery. So this worked for us:
import bindJustifiedGalleryToJQuery from 'justifiedGallery/dist/js/jquery.justifiedGallery'
// `jquery.justifiedGallery.js` exports this function on line 13.
// It takes a "root" (in case jquery isn't defined yet and it has to find it) and jquery.
// But if you provide jquery, then it doesn't need the root.
bindJustifiedGalleryToJQuery(null, $);
document.addEventListener('DOMContentLoaded', () => {
// do our initialisation
})
Not sure if this is the intended behaviour or not, but posting this in case other people run into similar problems.
The text was updated successfully, but these errors were encountered:
When we switched from using Webpacker to Vite to bundle our javascript, the initialisation broke.
We were doing:
With Vite, it seems that a different code path gets hit, and the import returns a function that we need to call to bind justifiedGallery with jquery. So this worked for us:
Not sure if this is the intended behaviour or not, but posting this in case other people run into similar problems.
The text was updated successfully, but these errors were encountered: