|
1 | 1 | import { normalize } from 'path';
|
2 | 2 | import { getGlobalVariable } from '../../utils/env';
|
3 |
| -import { appendToFile, expectFileToMatch, writeFile } from '../../utils/fs'; |
| 3 | +import { appendToFile, expectFileToMatch, replaceInFile, writeFile } from '../../utils/fs'; |
4 | 4 | import { installPackage } from '../../utils/packages';
|
5 |
| -import { exec, ng, silentNpm } from '../../utils/process'; |
6 |
| -import { isPrereleaseCli, updateJsonFile } from '../../utils/project'; |
| 5 | +import { exec, ng } from '../../utils/process'; |
| 6 | +import { updateJsonFile } from '../../utils/project'; |
7 | 7 |
|
8 | 8 | const snapshots = require('../../ng-snapshot/package.json');
|
9 | 9 |
|
10 | 10 | export default async function () {
|
11 | 11 | const argv = getGlobalVariable('argv');
|
12 | 12 | const veEnabled = argv['ve'];
|
13 |
| - const tag = (await isPrereleaseCli()) ? 'next' : 'latest'; |
14 | 13 |
|
15 |
| - // @nguniversal/express-engine currently relies on ^0.1100.0-rc.2 of @angular-devkit/architect |
16 |
| - // which is not present in the local package registry and not semver compatible with ^11.0.0-next.7 |
17 |
| - const { stdout: stdout1 } = await silentNpm('pack', '@angular-devkit/[email protected]', '--registry=https://registry.npmjs.org'); |
18 |
| - await silentNpm('publish', stdout1.trim(), '--registry=http://localhost:4873', '--tag=minor'); |
19 |
| - |
20 |
| - // @nguniversal/express-engine currently relies on ^11.0.0-rc.2 of @angular-devkit/core |
21 |
| - // which is not present in the local package registry and not semver compatible prerelease version of ^11.0.0-next.7 |
22 |
| - const { stdout: stdout2 } = await silentNpm('pack', '@angular-devkit/[email protected]', '--registry=https://registry.npmjs.org'); |
23 |
| - await silentNpm('publish', stdout2.trim(), '--registry=http://localhost:4873', '--tag=minor'); |
24 |
| - |
25 |
| - await ng('add', `@nguniversal/express-engine@${tag}`); |
| 14 | + await ng('generate', 'universal', '--client-project', 'test-project'); |
26 | 15 |
|
27 | 16 | const isSnapshotBuild = getGlobalVariable('argv')['ng-snapshots'];
|
28 | 17 | if (isSnapshotBuild) {
|
@@ -82,6 +71,8 @@ export default async function () {
|
82 | 71 | );
|
83 | 72 | }
|
84 | 73 |
|
| 74 | + await replaceInFile('tsconfig.server.json', 'src/main.server.ts', 'server.ts'); |
| 75 | + await replaceInFile('angular.json', 'src/main.server.ts', 'server.ts'); |
85 | 76 |
|
86 | 77 | await ng('run', 'test-project:server:production', '--optimization', 'false');
|
87 | 78 |
|
|
0 commit comments