diff --git a/apps/docs/docs/management/custom-widgets/trusted-packages.mdx b/apps/docs/docs/management/custom-widgets/trusted-packages.mdx index a84699c40..9ee0e70b2 100644 --- a/apps/docs/docs/management/custom-widgets/trusted-packages.mdx +++ b/apps/docs/docs/management/custom-widgets/trusted-packages.mdx @@ -77,6 +77,10 @@ Homarr provides React, Mantine, and `@homarr/widget-sdk` as shared host modules. from Homarr's installed version, which is recorded in the artifact lock. The reference packages show how to use the SDK for host dimensions, theme and locale, options, state, commands, data queries, and advanced views. Put additional dependencies in the package's dependency map rather than copying Homarr's internal source tree. +Production images include the widget compiler's JavaScript, native esbuild executable, and bundled icon sources. +When customizing Homarr's standalone build, retain these runtime assets and scope tracing includes to their files; +whole-package recursive globs can fail on pnpm dependency directory symlinks. + Use `WidgetScope` to compose components with independent state and command IDs. Commands registered through `useWidgetCommands` remain registered across unrelated host updates and are removed when their component unmounts. `useWidgetServices().confirm(...)` resolves to `true` on confirmation and `false` on cancellation or dismissal, diff --git a/apps/nextjs/next.config.ts b/apps/nextjs/next.config.ts index 6df6681fa..806153aa5 100644 --- a/apps/nextjs/next.config.ts +++ b/apps/nextjs/next.config.ts @@ -47,9 +47,10 @@ const nextConfig: NextConfig = { outputFileTracingRoot: path.resolve(import.meta.dirname, "../.."), outputFileTracingIncludes: { "/*": [ - "../../node_modules/esbuild/**/*", - "../../node_modules/@esbuild/**/*", - "../../node_modules/@tabler/icons-react/**/*", + // esbuild is automatically traced as an external, preserving its platform binary links. + // Recursive package globs instead trace pnpm dependency directory symlinks as files. + "../../node_modules/@tabler/icons-react/package.json", + "../../node_modules/@tabler/icons-react/dist/**/*", "../../packages/widget-sdk/package.json", "../../packages/widget-sdk/src/**/*", ],