Does NX dynamic module federation support SSR

63 views Asked by At

Does NX dynamic module federation support SSR? If so can you please share any documentation available!!

Reference link or a code snippet to understand the development/deployment.

Somewhere in github forum I read, NX doesnt support dynamic module federation for SSR served MFEs.

Similar problem reference https://github.com/nrwl/nx/issues/10887

1

There are 1 answers

0
John Martin On

The answer is yes!

Let's try to create test project follow steps below:

npx create-nx-workspace --name=test--preset=apps --nxCloud=skip && cd test
npx nx add @nx/angular 
npx nx g @nx/angular:host apps/host --dynamic --ssr --standalone --style=scss --addTailwind --e2eTestRunner=playwright --projectNameAndRootFormat=as-provided --prefix=host
npx nx g @nx/angular:remote apps/remote-a --host=host --ssr --standalone --style=scss --addTailwind --e2eTestRunner=playwright --projectNameAndRootFormat=as-provided --prefix=remote-a
npx nx g @nx/angular:remote apps/remote-b --host=host --ssr --standalone --style=scss --addTailwind --e2eTestRunner=playwright --projectNameAndRootFormat=as-provided --prefix=remote-b
npx nx serve host --devRemotes=remote-a,remote-b

But there is a note here that the serve command will not work properly without devRemotes config