Add webpack exclude to dynamic import

This commit is contained in:
shamoon 2026-03-18 11:54:54 -07:00
parent daa1c27d9b
commit de0c8558fb
No known key found for this signature in database

View File

@ -73,7 +73,13 @@ export default function Component({ service }) {
?.filter((integration) => integration?.type)
.map((integration) => ({
// Include the extension so Vite/Vitest can statically validate the import base.
service: dynamic(() => import(`./integrations/${integration.type}.jsx`)),
service: dynamic(
() =>
import(
/* webpackExclude: /\.test\.jsx$/ */
`./integrations/${integration.type}.jsx`
),
),
widget: { ...widget, ...integration },
})) ?? [],
[widget],