fix: import map onnxruntime-web pour @imgly/background-removal CDN

This commit is contained in:
2026-06-09 12:09:58 +02:00
parent 2efe339576
commit 0b26a61f90
+16
View File
@@ -13,6 +13,22 @@ export const metadata: Metadata = {
export default function RootLayout({ children }: { children: React.ReactNode }) { export default function RootLayout({ children }: { children: React.ReactNode }) {
return ( return (
<html lang="fr"> <html lang="fr">
<head>
{/* Import map requis par @imgly/background-removal chargé depuis CDN */}
<script
type="importmap"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: JSON.stringify({
imports: {
'onnxruntime-web': 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.all.min.mjs',
'onnxruntime-web/webgpu': 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.webgpu.min.mjs',
'onnxruntime-web/wasm': 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.wasm.min.mjs',
},
}),
}}
/>
</head>
<body className={inter.className}> <body className={inter.className}>
<SessionProvider>{children}</SessionProvider> <SessionProvider>{children}</SessionProvider>
</body> </body>