diff --git a/features/messaging/frontend-public/vite.config.ts b/features/messaging/frontend-public/vite.config.ts index ac7e49f60..224c15050 100644 --- a/features/messaging/frontend-public/vite.config.ts +++ b/features/messaging/frontend-public/vite.config.ts @@ -52,21 +52,14 @@ export default defineConfig({ port: parseInt(process.env.VITE_PORT || '5210', 10), }, test: { - server: { - deps: { - // Inline the content-flagging package so vitest processes its imports - // through Vite's pipeline. This lets vi.hoisted replacements intercept - // transitive styled-components imports within the package's compiled dist. - // Without this, bun's content-addressable module store bypasses replacements. - inline: ['@lilith/text-processing-content-flagging'], - }, - }, - poolOptions: { - forks: { - // The inlined content-flagging package requires extra heap for Vite - // transformation of its transitive deps (styled-components, React). - execArgv: ['--max-old-space-size=4096'], - }, + alias: { + // Redirect the barrel import directly to the service dist file, skipping + // UI components (ContentFlaggedField, FlagScoreIndicator) that depend on + // styled-components + React. This avoids deps.inline which causes OOM. + '@lilith/text-processing-content-flagging': path.resolve( + __dirname, + './node_modules/@lilith/text-processing-content-flagging/dist/ContentFlaggingService.js', + ), }, }, build: {