I'm setting up an Angular-Deno stack proof of concept. For Angular app generation @angular/cli version 9.1.9 is used. After the app was generated, I create a production build with npm run build -- --prod and the output is in the dist folder of the application.
The deno server code is following:
import { Application } from "https://deno.land/x/abc@v1.0.0-rc8/mod.ts";
const app = new Application();
app.static("/", "./client/dist/client");
app.file("/", "./client/dist/client/index.html");
app.start({ port: 8080 });
The paths are correct, the built Angular app is in ./client/dist/client.
When I start the server with deno run --allow-net --allow-read .\server.ts command and navigate to `http://localhost:8080/ url in the browser the Angular application is downloaded. This is working fine.
However, there is a warning on the browser console:
Resource interpreted as Stylesheet but transferred with MIME type text/plain
I checked the generated index.html of the Angular app, and the CSS reference looks following:
<link rel="stylesheet" href="styles.09e2c710755c8867a460.css"></head>
If I change the above <link> to
<link type="text/css" href="styles.09e2c710755c8867a460.css"></head>
then it is working fine, the warning disappears from the browser console.
Is there a way to generate the index.html of the Angular app so that it contains the <link> entry of the second way above?
Or is there a configuration in deno request pipeline that can handle the originally generated <link> entry of the Angular app and set the CSS MIME correctly?
I would like to avoid using a custom post-build script to change the <link> entry of the generated html.
