我有一些CSS文件,该文件包含在angular.json文件中,在其中定义了构建的配置文件。这样整个应用程序都具有这些文件。 它会自行加载CSS,但由于某些奇怪的原因,CSS文件中引用的字体不会加载。 我不知道为什么会这样。 我认为该json文件是问题的原因是因为更改后字体停止加载。
这是整个配置文件
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"frdemo-front-end": {
"root": "",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref": "/demo/S/S/S/insure/",
"polyfills": "target/frdemo/ng/polyfills.ts",
"styles": [
{
"input": "target/frdemo/ng/css/common-layout-ng.css"
},
{
"input": "target/frdemo/ng/css/funnels.css"
}
],
"scripts": []
},
"configurations": {
"production-fr": {
"fileReplacements": [
{
"src": "target/frdemo/ng/environments/environment.ts",
"replaceWith": "target/frdemo/ng/environments/environment.prod.ts"
}
],
"index": "target/frdemo/ng/app/insure/index.html",
"main": "target/frdemo/ng/app/insure/frdemo-policy-manager-root/frdemo-policy-manager-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/insure/tsconfig.in.prod.json",
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"vendorChunk": true,
"buildOptimizer": true,
"outputPath": "target/frdemo/ng/dist/fr",
"i18nLocale": "fr"
},
"production-en": {
"fileReplacements": [
{
"src": "target/frdemo/ng/environments/environment.ts",
"replaceWith": "target/frdemo/ng/environments/environment.prod.ts"
}
],
"index": "target/frdemo/ng/app/insure/index.html",
"main": "target/frdemo/ng/app/insure/frdemo-policy-manager-root/frdemo-policy-manager-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/insure/tsconfig.in.prod.json",
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"vendorChunk": true,
"buildOptimizer": true,
"outputPath": "target/frdemo/ng/dist/en",
"i18nLocale": "en",
"i18nFormat": "xlf",
"i18nFile": "target/frdemo/ng/locale/messages.en.xlf",
"i18nMissingTranslation": "ignore"
},
"en": {
"index": "src/main/webapp/ng/app/insure/index.html",
"main": "src/main/webapp/ng/app/insure/frdemo-policy-manager-root/frdemo-policy-manager-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/insure/tsconfig.in.dev.json",
"outputHashing": "all",
"vendorChunk": true,
"extractCss": true,
"outputPath": "target/frdemo/ng/dist/en",
"i18nLocale": "en",
"i18nFormat": "xlf",
"i18nFile": "src/main/webapp/ng/locale/messages.en.xlf",
"i18nMissingTranslation": "ignore"
},
"fr": {
"index": "src/main/webapp/ng/app/insure/index.html",
"main": "src/main/webapp/ng/app/insure/frdemo-policy-manager-root/frdemo-policy-manager-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/insure/tsconfig.in.dev.json",
"outputHashing": "all",
"vendorChunk": true,
"extractCss": true,
"outputPath": "target/frdemo/ng/dist/fr",
"i18nLocale": "fr"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "frdemo-front-end:build:production-en"
}
}
}
},
"demo-frauto-wc": {
"root": "",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"polyfills": "target/frdemo/ng/polyfills.ts",
"tsConfig": "tsconfig-wc.json",
"extractCss": true,
"namedChunks": false,
"vendorChunk": false,
"outputPath": "target/frdemo/ng/dist/wc",
"index": "src/main/webapp/ng/app/web-component/demo-frauto-wc/proposal/index.html",
"main": "src/main/webapp/ng/app/web-component/demo-frauto-wc/proposal/demo-frauto-wc.main.ts",
"styles": [
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/normalize.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/common.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/components.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/funnel.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/style-pi-core.css"
}
],
"scripts": [
{
"input": "node_modules/document-register-element/build/document-register-element.js"
},
{
"input": "src/main/webapp/js/jquery-2.2.4.min.js"
}
]
},
"configurations": {
"production-fr": {
"optimization": false,
"sourceMap": true,
"aot": false,
"outputHashing": "all",
"buildOptimizer": false,
"i18nLocale": "fr",
"fileReplacements": [
{
"src": "src/main/webapp/ng/environments/environment.ts",
"replaceWith": "src/main/webapp/ng/environments/environment.wc-prod.ts"
}
]
},
"fr": {
"fileReplacements": [
{
"src": "src/main/webapp/ng/environments/environment.ts",
"replaceWith": "src/main/webapp/ng/environments/environment.wc-prod.ts"
}
],
"i18nLocale": "fr"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo-frauto-wc:build"
},
"configurations": {
"production-fr": {
"browserTarget": "demo-frauto-wc:build:production-fr"
},
"fr": {
"browserTarget": "demo-frauto-wc:build:fr"
}
}
}
}
},
"client-space": {
"root": "",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref": "/demo/S/S/S/web-insure/",
"polyfills": "target/frdemo/ng/polyfills.ts",
"styles": [
{
"input": "target/frdemo/ng/css/common-layout-ng.css"
},
{
"input": "target/frdemo/ng/css/funnels.css"
}
],
"scripts": []
},
"configurations": {
"production-fr": {
"fileReplacements": [
{
"src": "target/frdemo/ng/environments/environment.ts",
"replaceWith": "target/frdemo/ng/environments/environment.prod.ts"
}
],
"index": "target/frdemo/ng/app/web-insure/index.html",
"main": "target/frdemo/ng/app/web-insure/frdemo-policy-client-root/frdemo-policy-client-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/web-insure/tsconfig.wi.prod.json",
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"vendorChunk": true,
"buildOptimizer": true,
"outputPath": "target/frdemo/ng/dist/wi/fr",
"i18nLocale": "fr"
}
}
}
}
},
"web-space": {
"root": "",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref": "/demo/S/S/S/web-insure-quote/",
"polyfills": "target/frdemo/ng/polyfills.ts",
"styles": [
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/normalize.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/common.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/components.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/funnel.css"
},
{
"input": "target/frdemo/ng/app/business-frdemo/frdemo-client-side/css/style-pi-core.css"
}
],
"scripts": [
{
"input": "src/main/webapp/js/jquery-2.2.4.min.js"
}
]
},
"configurations": {
"production-fr": {
"fileReplacements": [
{
"src": "target/frdemo/ng/environments/environment.ts",
"replaceWith": "target/frdemo/ng/environments/environment.prod.ts"
}
],
"index": "target/frdemo/ng/app/web-insure-quote/index.html",
"main": "target/frdemo/ng/app/web-insure-quote/frdemo-policy-web-root/frdemo-policy-web-root.main.ts",
"tsConfig": "src/main/webapp/ng/app/web-insure-quote/tsconfig.wiq.prod.json",
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": true,
"aot": false,
"vendorChunk": false,
"buildOptimizer": false,
"outputPath": "target/frdemo/ng/dist/wc/fr",
"i18nLocale": "fr"
}
}
}
}
}
}
}
有问题的CSS文件都在“ frdemo-client-side”中,字体在“ fnt”文件夹下的文件夹中,而CSS文件在“ css”文件夹中。