From a156cf8a25fb1d19b9bab1d3ba151e1b39a49a9f Mon Sep 17 00:00:00 2001 From: Satya Deep Maheshwari Date: Tue, 14 Jan 2025 14:32:25 +0530 Subject: [PATCH] Add smartcrops config --- scripts/aem-assets-plugin-support.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/aem-assets-plugin-support.js b/scripts/aem-assets-plugin-support.js index c590901147..958f2c80b8 100644 --- a/scripts/aem-assets-plugin-support.js +++ b/scripts/aem-assets-plugin-support.js @@ -6,12 +6,22 @@ const blocks = ['video']; // Initialize the aem-assets-plugin. export default async function assetsInit() { - const { loadBlock, createOptimizedPicture } = await import(`${codeBasePath}/scripts/aem-assets.js`); + const { + loadBlock, + createOptimizedPicture, + decorateExternalImages, + } = await import(`${codeBasePath}/scripts/aem-assets.js`); window.hlx = window.hlx || {}; window.hlx.aemassets = { codeBasePath, blocks, loadBlock, createOptimizedPicture, + decorateExternalImages, + smartCrops: { + Small: { minWidth: 0, maxWidth: 767 }, + Medium: { minWidth: 768, maxWidth: 1023 }, + Large: { minWidth: 1024, maxWidth: 9999 }, + }, }; }