Skip to content

Commit 90eedcf

Browse files
committed
refactor(@schematics/angular): mvoe @angular/ssr dependency to server schematic
This change is necessary as the `@angular/ssr` package is now required for all types of server-side rendering, including SSG and app-shell.
1 parent 69b6541 commit 90eedcf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/schematics/angular/server/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ function addDependencies(skipInstall: boolean | undefined): Rule {
141141
const install = skipInstall ? InstallBehavior.None : InstallBehavior.Auto;
142142

143143
return chain([
144+
addDependency('@angular/ssr', latestVersions.AngularSSR, {
145+
type: DependencyType.Default,
146+
install,
147+
}),
144148
addDependency('@angular/platform-server', coreDep.version, {
145149
type: DependencyType.Default,
146150
install,
@@ -154,7 +158,7 @@ function addDependencies(skipInstall: boolean | undefined): Rule {
154158
}
155159

156160
export default function (options: ServerOptions): Rule {
157-
return async (host: Tree, context: SchematicContext) => {
161+
return async (host: Tree) => {
158162
const workspace = await getWorkspace(host);
159163
const clientProject = workspace.projects.get(options.project);
160164
if (clientProject?.extensions.projectType !== 'application') {

packages/schematics/angular/ssr/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,6 @@ function addDependencies({ skipInstall }: SSROptions, isUsingApplicationBuilder:
298298
const install = skipInstall ? InstallBehavior.None : InstallBehavior.Auto;
299299

300300
const rules: Rule[] = [
301-
addDependency('@angular/ssr', latestVersions.AngularSSR, {
302-
type: DependencyType.Default,
303-
install,
304-
}),
305301
addDependency('express', latestVersions['express'], {
306302
type: DependencyType.Default,
307303
install,

0 commit comments

Comments
 (0)