@pegakit/pegakit
Version:
The living styleguide, pattern library, UI ToolKit, and front-end build tools that power Pega's digital web properties.
33 lines (30 loc) • 949 B
JavaScript
window.lazySizesConfig = window.lazySizesConfig || {};
// use .js-lazyload instead of .lazyload
window.lazySizesConfig.lazyClass = 'js-lazyload';
// var img = document.createElement('img');
// var isWSupported = ('sizes' in img);
require('picturefill');
require('lazysizes/plugins/bgset/ls.bgset');
require('lazysizes');
//
// function runLazySizes() {
//
// }
//
// // Check if polyfill required
// if (!isWSupported) {
// // Webpack parses the inside of require.ensure at build time to know that intl
// // should be bundled separately. You could get the same effect by passing
// // ['intl'] as the first argument.
// require.ensure([], () => {
// // Ensure only makes sure the module has been downloaded and parsed.
// // Now we actually need to run it to install the polyfill.
//
//
// // Carry on
// runLazySizes();
// });
// } else {
// // Polyfill wasn't needed, carry on
// runLazySizes();
// }