While integrating OIDC into my Angular app, I had to add a separate authentication page(originally named auth.html). However after bundling and serving my application using ‘ng serve’ I noticed that I couldn’t reach my ‘auth.html’ file and I got an error message instead…
The solution was obvious, any extra files you want to include should be added to the assets section inside the angular-cli.json file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"apps": [ | |
{ | |
"root": "src", | |
"outDir": "", | |
"assets": [ | |
"assets", | |
"favicon.ico", | |
"auth.html" | |
], | |
"index": "index.html", | |
"main": "main.ts", | |
"polyfills": "polyfills.ts", | |
"test": "test.ts", | |
"tsconfig": "tsconfig.app.json", | |
"testTsconfig": "tsconfig.spec.json", | |
"prefix": "app", | |
"styles": [ | |
"styles.css" | |
], |