fix: corriger le chemin CDN @imgly (index.mjs v1.7.0)

This commit is contained in:
2026-05-27 10:37:46 +02:00
parent 7e2bbfcca2
commit 4ea8eb3805
+3 -2
View File
@@ -4,14 +4,15 @@
* puis mis en cache automatiquement dans le navigateur.
*/
const CDN = 'https://cdn.jsdelivr.net/npm/@imgly/background-removal/dist/';
const CDN_VERSION = '1.7.0';
const CDN = `https://cdn.jsdelivr.net/npm/@imgly/background-removal@${CDN_VERSION}/dist/`;
// Chargement paresseux de la librairie (évite de bloquer le rendu initial)
let _removeBg = null;
async function loadLib() {
if (_removeBg) return _removeBg;
const mod = await import(CDN + 'bundle.browser.esm.js');
const mod = await import(CDN + 'index.mjs');
_removeBg = mod.removeBackground;
return _removeBg;
}