Problem
`@originjs/vite-plugin-federation` ≤1.4.x mangles its own placeholder identifiers (`_federation_expose`, `_federation_shared`) when esbuild or terser minification is applied, causing the remote to fail at runtime in the shell.
Current workaround in `packages/browser-app/vite.config.ts`:
```ts
build: {
minify: false, // affects the ENTIRE build, not just the federation chunk
}
```
This ships the production bundle (~1.6 MB exposed Dashboard chunk + main bundle) completely unminified, causing a page-load regression and exposing source-level identifiers.
Goal
Re-enable minification for production builds while keeping Module Federation working.
Investigation paths
- Upgrade vite-plugin-federation — check if a version > 1.4.1 fixes minification.
- Selective exclusion via rollupOptions — skip minification for remoteEntry.js chunk only.
- Terser keep_fnames — may preserve federation identifiers while minifying the rest.
- Check upstream: https://github.com/originjs/vite-plugin-federation/issues
Acceptance criteria
- pnpm build produces a minified dist/assets/remoteEntry.js
- Shell mounts cv-builder Dashboard without runtime errors
- No _federation* identifier mangling in output
Problem
`@originjs/vite-plugin-federation` ≤1.4.x mangles its own placeholder identifiers (`_federation_expose`, `_federation_shared`) when esbuild or terser minification is applied, causing the remote to fail at runtime in the shell.
Current workaround in `packages/browser-app/vite.config.ts`:
```ts
build: {
minify: false, // affects the ENTIRE build, not just the federation chunk
}
```
This ships the production bundle (~1.6 MB exposed Dashboard chunk + main bundle) completely unminified, causing a page-load regression and exposing source-level identifiers.
Goal
Re-enable minification for production builds while keeping Module Federation working.
Investigation paths
Acceptance criteria