I am building a web application with angular for my web dev course. This application makes use of the angular material library. Today, I tried to deploy my angular application on my server which I built from scratch with node js (I am using http, not express in case that matters). I successfully ran ng build --prod
, created a dist folder, and deployed my application.
The issue is that when I run the deployed version of my application, the angular material components don't work. The best way to explain it is with pictures.
Here is what the app looks like when it is run in development mode:
Here is what the app looks like when it is deployed and run on the server:
All of the material components are gone/aren't displayed properly. Why does this happen? Is there something special/important I have to do to include the libraries/modules in the build version of my application? I am getting the following warning in the console:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/styles.80f2d8e9e393f3581758.css".
Any help is greatly appreciated!