Skip to content

Commit

Permalink
feat(angular): host mf should use module-federation-dev-ssr for serve…
Browse files Browse the repository at this point in the history
…-ssr (#13510)
  • Loading branch information
Coly010 authored Nov 30, 2022
1 parent a1bac90 commit 183e3c1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,23 @@ Object {
}
`;
exports[`Host App Generator --ssr should generate the correct files 10`] = `
Object {
"configurations": Object {
"development": Object {
"browserTarget": "test:build:development",
"serverTarget": "test:server:development",
},
"production": Object {
"browserTarget": "test:build:production",
"serverTarget": "test:server:production",
},
},
"defaultConfiguration": "development",
"executor": "@nrwl/angular:module-federation-dev-ssr",
}
`;
exports[`Host App Generator should generate a host app with a remote 1`] = `
"const { withModuleFederation } = require('@nrwl/angular/module-federation');
const config = require('./module-federation.config');
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/host/host.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ describe('Host App Generator', () => {
tree.read(`apps/test/src/app/app.routes.ts`, 'utf-8')
).toMatchSnapshot();
expect(project.targets.server).toMatchSnapshot();
expect(project.targets['serve-ssr']).toMatchSnapshot();
});
});
});
3 changes: 3 additions & 0 deletions packages/angular/src/generators/host/lib/add-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export async function addSsr(tree: Tree, options: Schema, appName: string) {
path: joinPathFragments(project.root, 'webpack.server.config.js'),
};

project.targets['serve-ssr'].executor =
'@nrwl/angular:module-federation-dev-ssr';

updateProjectConfiguration(tree, appName, project);

const installTask = addDependenciesToPackageJson(
Expand Down

0 comments on commit 183e3c1

Please sign in to comment.