From d68e5a1f5670e254ba60cf0cb5f9bda7edd187be Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 8 May 2021 17:55:31 -0500 Subject: [PATCH] Load lazy sizes from row to reduce usingComponent --- components-eleventy/video/card.js | 2 +- components-eleventy/video/row.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components-eleventy/video/card.js b/components-eleventy/video/card.js index 2035852..a21fb49 100644 --- a/components-eleventy/video/card.js +++ b/components-eleventy/video/card.js @@ -16,7 +16,7 @@ export default async function ( video, options = {} ) { } = options // Setup inline lazysizes - await this.usingComponent( 'node_modules/lazysizes/lazysizes.min.js' ) + // await this.usingComponent( 'node_modules/lazysizes/lazysizes.min.js' ) // console.log('video', video) diff --git a/components-eleventy/video/row.js b/components-eleventy/video/row.js index 43675c4..a796970 100644 --- a/components-eleventy/video/row.js +++ b/components-eleventy/video/row.js @@ -23,9 +23,12 @@ export default async function ( videos, options = {} ) { const uid = Math.random().toString(36).substr(2, 9) const rowId = `row-${ uid }` - // Setup inline lazysizes + // Setup inline scroll script await this.usingComponent( 'helpers/scroll.js' ) + // Setup inline lazysizes + await this.usingComponent( 'node_modules/lazysizes/lazysizes.min.js' ) + // console.log('video', video) const renderedCards = await Promise.all(videos.map( async video => {