Skip to content

Commit

Permalink
refactor: Add the dynamic loading of LazySizes back in
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Apr 1, 2024
1 parent e5a09e8 commit 4bbaf4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/templates/frontend/lazysizes-fallback.twig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ if ('loading' in HTMLImageElement.prototype) {
source.removeAttribute('data-sizes');
}
});
} else {
// Dynamically import the LazySizes library
const script = document.createElement('script');
script.src = '{{ scriptSrc }}';
document.body.appendChild(script);
}

0 comments on commit 4bbaf4a

Please sign in to comment.