Skip to content

Commit

Permalink
Add smartcrops config
Browse files Browse the repository at this point in the history
  • Loading branch information
Satya Deep Maheshwari committed Jan 14, 2025
1 parent ca6663f commit a156cf8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/aem-assets-plugin-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
},
};
}

0 comments on commit a156cf8

Please sign in to comment.