I have an Angular 7 project which generates styles.[hash].css file in prod build.
I have an iframe within one of my components which loads a static html file defined within the same project (not an angular component, just plain static html).
I want to reuse styles of my project in my static html file which is loaded within the iframe. Is there a way to know the name of the styles.css file which is generated in the dist folder as an output of the prod build?
I am generating prod build using
ng build --aot --prod --stats-json
This generates a stats.json file which has the file names in field assetsByChunkName.
"assetsByChunkName": {
"runtime": "runtime.b2ebd3cc7f73d5966db1.js",
"main": "main.9872f510320bbf1b0ad9.js",
"polyfills": "polyfills.b2e1d6dfcc48e480634c.js",
"styles": "styles.4bd3b6df7eaeb9129b4d.css"
}
Is there a clean way to (may be using a plugin), to add following line in my iframe's html file like
<link rel="stylesheet" href="styles.4bd3b6df7eaeb9129b4d.css"> ?
Looking for a solution that will work in both ng serve and prod build of angular-cli
Note: I want to maintain the hash in prod files for its benefits