Net Core 2.1 Angular 项目使用 Angular CLI 6 设置 SSR 配置
Net Core 2.1 Angular project set up SSR config with Angular CLI 6
我使用 Visual Studio 2017 中内置的新 Net Core 2.1 Angular 模板创建了一个 angular 应用程序。此模板使用纯 angular-cli设置有利于以前的 webpack 配置。
该模板使用 angular 5.2,所以我使用 official update guide. After some additional tweaks like removing the "--extract-css" as described here 将其升级到 6,该应用程序再次运行良好。
出于 SEO 目的,我想激活 SSR,所以我使用了 MS 提供的 official guide。本指南在使用 Angular CLI 5 时有效(在迁移之前使用它),但我不知道如何使用 Angular CLI 6.
“.angular-cli.json”当然已被具有其他设置的 "angular.json" 文件所取代。所以我有点困惑如何设置它。
我的 package.json 看起来像这样:
{
"name": "xxx",
"version": "1.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
...
我使用 Visual Studio 2017 中内置的新 Net Core 2.1 Angular 模板创建了一个 angular 应用程序。此模板使用纯 angular-cli设置有利于以前的 webpack 配置。
该模板使用 angular 5.2,所以我使用 official update guide. After some additional tweaks like removing the "--extract-css" as described here 将其升级到 6,该应用程序再次运行良好。
出于 SEO 目的,我想激活 SSR,所以我使用了 MS 提供的 official guide。本指南在使用 Angular CLI 5 时有效(在迁移之前使用它),但我不知道如何使用 Angular CLI 6.
“.angular-cli.json”当然已被具有其他设置的 "angular.json" 文件所取代。所以我有点困惑如何设置它。
我的 package.json 看起来像这样:
{
"name": "xxx",
"version": "1.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
...