Я начинаю с: < /p>
Код: Выделить всё
npx -p @angular/cli@19 ng add @angular/ssr< /code> Это создано и обновляется требуемые файлы. После этого я установил ниже пакета < /li> npm install @angular/platform-server --legacy-peer-deps
Код: Выделить всё
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"dev:ssr": "ng run Angular-POMS:serve-ssr",
"serve:ssr": "node dist/Angular-POMS/server/main.js",
"build:ssr": "ng build && ng run Angular-POMS:server",
"prerender": "ng run Angular-POMS:prerender"
}
Ниже приведен серверный терминал Outpul < /p>
Код: Выделить всё
npm run dev:ssr
> [email protected] dev:ssr
> ng run Angular-POMS:serve-ssr
****************************************************************************************
This is a simple server for use in testing or debugging Angular applications locally.
It hasn't been reviewed for security issues.
DON'T USE IT FOR PRODUCTION!
****************************************************************************************
Components styles sourcemaps are not generated when styles optimization is enabled.
Components styles sourcemaps are not generated when styles optimization is enabled.
✔ Server application bundle generation complete.
Initial chunk files | Names | Raw size
vendor.js | vendor | 7.75 MB |
main.js | main | 96.01 kB |
| Initial total | 7.84 MB
Lazy chunk files | Names | Raw size
937.js | views-quote-quote-module | 3.59 MB |
565.js | views-order-order-module | 3.56 MB |
929.js | xhr2 | 15.65 kB |
140.js | views-account-account-module | 9.82 kB |
Build at: 2025-04-09T12:00:35.020Z - Hash: b0584ff083856287 - Time: 146208ms
✔ Browser application bundle generation complete.
⠋ Generating index html...9 rules skipped due to selector errors:
.table>>*>* -> Did not expect successive traversals.
.table-sm>>*>* -> Did not expect successive traversals.
.table-bordered>>* -> Did not expect successive traversals.
.table-bordered>>*>* -> Did not expect successive traversals.
.table-borderless>>*>* -> Did not expect successive traversals.
.form-floating>~label -> Did not expect successive traversals.
.btn-group>+.btn -> Did not expect successive traversals.
.btn-group>+.btn -> Did not expect successive traversals.
.btn-group-vertical>+.btn -> Did not expect successive traversals.
✔ Index html generation complete.
Initial chunk files | Names | Raw size | Estimated transfer size
main.js | main | 64.96 kB | 16.96 kB
scripts.js | scripts | 10.82 kB | 3.07 kB
7 unchanged chunks
Build at: 2025-04-09T12:00:55.730Z - Hash: 7128f687559f95fb - Time: 110769ms
Warning: D:\Github\Angular.POMS\Angular.POMS\src\app\Services\crypto\crypto.service.ts depends on 'crypto-js'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.dev/tools/cli/build#configuring-commonjs-dependencies
Warning: D:\Github\Angular.POMS\Angular.POMS\src\app\views\order\upload-order\upload-order.component.ts depends on 'csvtojson'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.dev/tools/cli/build#configuring-commonjs-dependencies
Compiled successfully.
** Angular Universal Live Development Server is listening on http://localhost:4200, open your browser on http://localhost:4200 **
(node:596) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
isPlatformBrowser server
Подробнее здесь: https://stackoverflow.com/questions/795 ... -angular-u