我正在尝试将 angular ssr 18 应用程序部署到我的本地 IIS。.NET Core 模板 + angular。当我从 Visual Studio 发布并将文件夹复制到 IIS 时,我的 API 可以工作,但 Angular 无法加载并且我得到...
我正在尝试将 angular ssr 18 应用程序部署到我的本地 IIS。.NET Core 模板 + angular。
当我从 Visual Studio 发布并将文件夹复制到 IIS 时,我的 API 可以工作,但 Angular 无法加载并且出现 404 错误。
我下载了 这个模板 并尝试发布它,但出现了同样的错误
这是我的 angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"test.web.application.client": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"standalone": false
},
"@schematics/angular:directive": {
"standalone": false
},
"@schematics/angular:pipe": {
"standalone": false
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist/test.web.application.client",
"browser": "browser"
},
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/assets",
"src/sitemap.xml",
"src/sitemaptest.xml",
"src/sitemap_ca.xml",
"src/sitemap_es.xml",
"src/sitemap_en.xml",
"src/sitemap_fr.xml",
"src/sitemap_de.xml",
"src/sitemap_pt.xml",
"src/sitemap_it.xml",
"src/robots.txt",
"src/robots_notracking.txt",
"src/robots_tracking.txt",
],
"allowedCommonJsDependencies": [
"moment",
"jquery",
"fast-deep-equal",
"rgbcolor",
"raf",
"guid-typescript",
"core-js/modules/web.dom-collections.iterator.js",
"core-js/modules/es.string.trim.js",
"core-js/modules/es.string.starts-with.js",
"core-js/modules/es.string.split.js",
"core-js/modules/es.string.replace.js",
"core-js/modules/es.string.match.js",
"core-js/modules/es.string.includes.js",
"core-js/modules/es.string.ends-with.js",
"core-js/modules/es.regexp.to-string.js",
"core-js/modules/es.promise.js",
"core-js/modules/es.array.reverse.js",
"core-js/modules/es.array.reduce.js",
"core-js/modules/es.array.iterator.js",
"core-js/modules/es.array.index-of.js",
"file-saver",
"js-sha256"
],
"styles": [
"src/assets/ion.rangeSlider.min.css",
"./node_modules/@angular/cdk/_index.scss",
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"src/assets/js/moment.min.js",
"src/assets/js/slick.min.js",
"src/assets/js/jquery.countdown.min.js",
"src/assets/js/ion.rangeSlider.min.js"
],
"server": "src/main.server.ts",
"prerender": false,
"ssr": {
"entry": "server.ts"
}
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "10mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"index": {
"input": "src/index.prod.html",
"output": "index.html"
},
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "test.web.application.client:build:production"
},
"development": {
"buildTarget": "test.web.application.client:build:development"
}
},
"defaultConfiguration": "development",
"options": {
"proxyConfig": "src/proxy.conf.js"
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "test.web.application.client:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": [],
"karmaConfig": "karma.conf.js"
}
}
}
}
},
"cli": {
"analytics": false
}
}