我的角度是 7,但最近我将它升级到 12.0.5。ng build 运行良好,ng serve 也在执行,没有任何错误,但总是收到上述警告。此外,我正在尝试在浏览器中打开这些 css 文件,如 localhost:4200/assets/core.css 我可以看到它正在加载css 文件,但不知道为什么这不适用于项目,从而导致不良样式和设计。
我的 index.html 看起来像
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="assets/css/core.css" >
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css" >
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-aNUYGqSUL9wG/vP7+cWZ5QOM4gsQou3sBfWRr/8S3R1Lv0rysEmnwsRKMbhiQX/O" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="assets/css/liwid.css">
<link rel="stylesheet" type="text/css" href="assets/css/styleguide.css">
<link rel="stylesheet" type="text/css" href="assets/css/custom.css">
我的 angular.json
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.js",
"node_modules/jquery/dist/jquery.slim.js",
"node_modules/popper.js/dist/umd/popper.min.js"
]