Extend JS functionality



I want to use a molecule that uses JS functionality normally in product detail page anywhere on the shop. How do I declare it globally available? I’ve tried in app.ts with import but when npm run yves is recompiled it throws an error that should include ‘new’



You can always include molecule from another module:

{% include molecule('component-name', 'ModuleName') with {
} only %}


I’ve included it and it shows properly, however the toggle functionality is not working even though it is a clean copy of a molecule implementation from the product detail page.
I have included it in the cmsBlock template and just the functionality is the problem, probably the molecule is not available globally