( projectSourceRoot: string, options: ServerOptions, isStandalone: boolean, )
| 335 | } |
| 336 | |
| 337 | function addServerFile( |
| 338 | projectSourceRoot: string, |
| 339 | options: ServerOptions, |
| 340 | isStandalone: boolean, |
| 341 | ): Rule { |
| 342 | return async (host) => { |
| 343 | const projectName = options.project; |
| 344 | const workspace = await readWorkspace(host); |
| 345 | const project = workspace.projects.get(projectName); |
| 346 | if (!project) { |
| 347 | throw new SchematicsException(`Invalid project name (${projectName})`); |
| 348 | } |
| 349 | const usingApplicationBuilder = isUsingApplicationBuilder(project); |
| 350 | const browserDistDirectory = usingApplicationBuilder |
| 351 | ? (await getApplicationBuilderOutputPaths(host, projectName)).browser |
| 352 | : await getLegacyOutputPaths(host, projectName, 'build'); |
| 353 | |
| 354 | return mergeWith( |
| 355 | apply(url(`./files/${usingApplicationBuilder ? 'application-builder' : 'server-builder'}`), [ |
| 356 | applyTemplates({ |
| 357 | ...strings, |
| 358 | ...options, |
| 359 | browserDistDirectory, |
| 360 | isStandalone, |
| 361 | }), |
| 362 | move(projectSourceRoot), |
| 363 | ]), |
| 364 | ); |
| 365 | }; |
| 366 | } |
| 367 | |
| 368 | const ssrSchematic: RuleFactory<SSROptions> = createProjectSchematic( |
| 369 | async (options, { project, tree, context }) => { |
no test coverage detected