Repository navigation
Expand file tree
/
Copy pathfederation.config.js
More file actions
29 lines (28 loc) · 1.55 KB
/
Copy pathfederation.config.js
File metadata and controls
29 lines (28 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// REMOTE bundle config for the Admin micro-frontend (native-federation remote
// name "admin"). The hugmesh.net host consumes the single exposed
// `./routes` module via loadRemoteModule({ remoteName: 'admin', exposedModule:
// './routes' }) and mounts ADMIN_ROUTES at /admin — so the remote name and the
// exposed module key MUST stay unchanged or the host's admin console breaks.
//
// The shared-deps surface + RxJS skip list live in ./federation-base.js so a
// change to the federation contract lands in one file, consistent with the host
// and every other HugMesh remote (games convention).
const { hugmeshRemote } = require('./federation-base');
module.exports = hugmeshRemote({
name: 'admin',
exposes: {
'./routes': './src/app/admin.routes.ts',
},
// native-federation's shared-bundler resolves @xterm/xterm via its UMD
// `main` entry (the package DOES ship ESM under `module`, but the share
// bundler doesn't pick it), producing a shared bundle exposing just
// `export default` — so the components' `import { Terminal } from
// '@xterm/xterm'` fails to link at runtime ("does not provide an export
// named 'Terminal'") and takes down the whole /admin route. Skipping it
// makes esbuild BUNDLE the package into the exposed chunks, where its
// interop resolves the named import. Don't cargo-cult this: extraSkip is
// only needed when the share bundler mis-picks an entry; a dep with a clean
// ESM share works fine shared.
// (Same extraSkip escape hatch hugmesh.games uses for unshareable deps.)
extraSkip: ['@xterm/xterm'],
});