diff --git a/plugins/artdirect/ls.artdirect.js b/plugins/artdirect/ls.artdirect.js index 3c348507..23a138fb 100644 --- a/plugins/artdirect/ls.artdirect.js +++ b/plugins/artdirect/ls.artdirect.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/aspectratio/ls.aspectratio.js b/plugins/aspectratio/ls.aspectratio.js index b22e7f69..74c8dbd6 100644 --- a/plugins/aspectratio/ls.aspectratio.js +++ b/plugins/aspectratio/ls.aspectratio.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/attrchange/ls.attrchange.js b/plugins/attrchange/ls.attrchange.js index 14bcb54d..0ed15739 100644 --- a/plugins/attrchange/ls.attrchange.js +++ b/plugins/attrchange/ls.attrchange.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/bgset/ls.bgset.js b/plugins/bgset/ls.bgset.js index d4f3a691..aa000df9 100644 --- a/plugins/bgset/ls.bgset.js +++ b/plugins/bgset/ls.bgset.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/blur-up/ls.blur-up.js b/plugins/blur-up/ls.blur-up.js index fa75a611..f4eb1384 100644 --- a/plugins/blur-up/ls.blur-up.js +++ b/plugins/blur-up/ls.blur-up.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/custommedia/ls.custommedia.js b/plugins/custommedia/ls.custommedia.js index cdea7dd7..a67b69f0 100644 --- a/plugins/custommedia/ls.custommedia.js +++ b/plugins/custommedia/ls.custommedia.js @@ -14,6 +14,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js b/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js index 05c1e6c8..51aaeba2 100644 --- a/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js +++ b/plugins/fix-edge-h-descriptor/ls.fix-edge-h-descriptor.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/fix-ios-sizes/fix-ios-sizes.js b/plugins/fix-ios-sizes/fix-ios-sizes.js index 70bd45aa..e322521e 100644 --- a/plugins/fix-ios-sizes/fix-ios-sizes.js +++ b/plugins/fix-ios-sizes/fix-ios-sizes.js @@ -24,6 +24,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/include/ls.include.js b/plugins/include/ls.include.js index a152a4b8..8a1d5898 100644 --- a/plugins/include/ls.include.js +++ b/plugins/include/ls.include.js @@ -12,6 +12,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/native-loading/ls.native-loading.js b/plugins/native-loading/ls.native-loading.js index b303f5e3..3eef77b2 100644 --- a/plugins/native-loading/ls.native-loading.js +++ b/plugins/native-loading/ls.native-loading.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/noscript/ls.noscript.js b/plugins/noscript/ls.noscript.js index dfe20e48..f3eac402 100644 --- a/plugins/noscript/ls.noscript.js +++ b/plugins/noscript/ls.noscript.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/object-fit/ls.object-fit.js b/plugins/object-fit/ls.object-fit.js index 9b83be13..162f1afe 100644 --- a/plugins/object-fit/ls.object-fit.js +++ b/plugins/object-fit/ls.object-fit.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/optimumx/ls.optimumx.js b/plugins/optimumx/ls.optimumx.js index 2d475ea6..6f4657b3 100644 --- a/plugins/optimumx/ls.optimumx.js +++ b/plugins/optimumx/ls.optimumx.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/parent-fit/ls.parent-fit.js b/plugins/parent-fit/ls.parent-fit.js index 9521961f..34e21fd8 100644 --- a/plugins/parent-fit/ls.parent-fit.js +++ b/plugins/parent-fit/ls.parent-fit.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/print/ls.print.js b/plugins/print/ls.print.js index 562a19d0..7aeaaaf5 100644 --- a/plugins/print/ls.print.js +++ b/plugins/print/ls.print.js @@ -12,6 +12,8 @@ In case the user starts to print lazysizes will load all images. if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/progressive/ls.progressive.js b/plugins/progressive/ls.progressive.js index 580bf186..b854cb31 100644 --- a/plugins/progressive/ls.progressive.js +++ b/plugins/progressive/ls.progressive.js @@ -11,6 +11,8 @@ This lazysizes plugin optimizes perceived performance by adding better support f if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/respimg/ls.respimg.js b/plugins/respimg/ls.respimg.js index 4fdcb452..4d38aeed 100644 --- a/plugins/respimg/ls.respimg.js +++ b/plugins/respimg/ls.respimg.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/rias/ls.rias.js b/plugins/rias/ls.rias.js index 3a8a4f69..5584e419 100644 --- a/plugins/rias/ls.rias.js +++ b/plugins/rias/ls.rias.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/static-gecko-picture/ls.static-gecko-picture.js b/plugins/static-gecko-picture/ls.static-gecko-picture.js index b99f9f88..aee7de72 100644 --- a/plugins/static-gecko-picture/ls.static-gecko-picture.js +++ b/plugins/static-gecko-picture/ls.static-gecko-picture.js @@ -11,6 +11,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/twitter/ls.twitter.js b/plugins/twitter/ls.twitter.js index 27fa9f39..e9f615c3 100644 --- a/plugins/twitter/ls.twitter.js +++ b/plugins/twitter/ls.twitter.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/unload/ls.unload.js b/plugins/unload/ls.unload.js index 9c52daea..ee0d3a5a 100644 --- a/plugins/unload/ls.unload.js +++ b/plugins/unload/ls.unload.js @@ -8,6 +8,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/unveilhooks/ls.unveilhooks.js b/plugins/unveilhooks/ls.unveilhooks.js index 1f2189f1..6675f1ac 100644 --- a/plugins/unveilhooks/ls.unveilhooks.js +++ b/plugins/unveilhooks/ls.unveilhooks.js @@ -42,6 +42,8 @@ For background images, use data-bg attribute: if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else { diff --git a/plugins/video-embed/ls.video-embed.js b/plugins/video-embed/ls.video-embed.js index 8a0d6e7f..18430f3d 100644 --- a/plugins/video-embed/ls.video-embed.js +++ b/plugins/video-embed/ls.video-embed.js @@ -9,6 +9,8 @@ if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); + } else if (typeof define == 'function' && define.amd) { + require(['lazysizes'], factory); } else if(window.lazySizes) { globalInstall(); } else {