fix: corriger le chemin CDN @imgly (index.mjs v1.7.0)
This commit is contained in:
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user