Je viens de mettre à jour angular vers la dernière 9.0.0-next.4
. Je n'utilise pas le routage mais soudainement après la mise à jour, je continue à voir cet avertissement. Comment supprimer cet avertissement
AVERTISSEMENT dans
src/war/angular/src/app/app-routing.module.ts
fait partie de la compilation TypeScript mais n'est pas utilisé. Ajoutez uniquement des points d'entrée aux propriétés "fichiers" ou "inclure" dans votre tsconfig.
package.json
"dependencies": {
"@angular/animations": "^9.0.0-next.4",
"@angular/cdk": "^8.1.4",
"@angular/common": "^9.0.0-next.4",
"@angular/compiler": "^9.0.0-next.4",
"@angular/core": "^9.0.0-next.4",
"@angular/forms": "^9.0.0-next.4",
"@angular/material": "^8.1.4",
"@angular/platform-browser": "^9.0.0-next.4",
"@angular/platform-browser-dynamic": "^9.0.0-next.4",
"@angular/router": "^9.0.0-next.4",
"@ng-bootstrap/ng-bootstrap": "^5.1.0",
"bootstrap": "^4.3.1",
"hammerjs": "^2.0.8",
"moment": "^2.24.0",
"ng-image-slider": "^2.0.1",
"panzoom": "^8.1.2",
"rxjs": "~6.5.2",
"tslib": "^1.9.0",
"zone.js": "^0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.2",
"@angular/cli": "^8.3.2",
"@angular/compiler-cli": "^9.0.0-next.4",
"@angular/language-service": "^9.0.0-next.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "^5.15.0",
"TypeScript": "^3.5.3"
}
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
Mis à jour à Angular 9 aujourd'hui et a reçu des avertissements. Ma solution a été d'ajouter ce tableau "files" sans le "src" dans le chemin d'accès.
"files": [
"main.ts",
"polyfills.ts"
],
Mon fichier tsconfig.app.json complet est:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"types": ["node"]
},
"files": [
"main.ts",
"polyfills.ts"
],
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}