I have a components library for Angular that relies on line-awesome icons. To include the necessary fonts and styles, I am using a CDN in the main SCSS file as shown below:
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;600;700;800;900&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css');
Everything functions correctly when I run the application locally, with both the Nunito font and icons loading properly. However, when attempting to import the library from an external project, I encounter an issue where the icons do not render and the browser console displays this error:
"Refused to apply style from 'http://localhost:4200/fonts/line-awesome/css/line-awesome.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."
I am puzzled by why the first font loads without issues while the second does not, appearing as text/html instead of text/css. Additionally, it is confusing to see the Google font downloading from the CDN while the second import tries to fetch the font locally (http://localhost:4200/fonts/...)
https://i.sstatic.net/hWoA6.png
https://i.sstatic.net/UzUbV.png
Although I could resolve this by directly adding the CSS file in the "styles" property of angular.json, I prefer not to impose specific configurations on applications using my library.