Js from third-party module isn't called with dev/js/merge_files 1 #347
-
Hi. I'm trying to add Magefan blog (https://github.com/magefan/module-blog) to the site using Breeze theme. It works in dev mode when js files aren't merged, but when I run
I see that the code is added to default.min.js, but then the class Lazyload is never called. From what I see, in an unmerged version the function that automatically mounts the components has these values:
And when I set
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! Yes, there is a difference in how scripts behave when bundled or not. When the script is not bundled Breeze tries to automatically assign its component according to filepath. When the script is bundled we can't do that. There are two ways of fixing this issue:
p.s. We already have an integration with magefan/blog, so I welcome you to add a PR with lazyload integration :) |
Beta Was this translation helpful? Give feedback.
Hello!
Yes, there is a difference in how scripts behave when bundled or not.
When the script is not bundled Breeze tries to automatically assign its component according to filepath. When the script is bundled we can't do that.
There are two ways of fixing this issue:
load
rules, so it will never be bundled.component: 'Magefan_Blog/js/lazyload'
to the component as described in the integration tutorial: https://breezefront.com/docs/integration-example#3-add-component-namep.s. We already have an integration with magefan/blog, so I welcome you to add a PR with lazyload integration :)
p.p.s We use load rules in our integration. Have a look: htt…