I had a lot of issues because my application is hosted inside a subfolder and for that reason the relative /assets/
path, which is referenced inside .scss
files, doesn't work.
The solution was to enable the --rebaseRootRelativeCssUrls
option to get the expected behaviour. With that option, the build process has adjusted my /assets/
paths by injecting the "--base-href" value and now the referenced images and fonts are loading correctly.
However, I see in the documentation that the option is deprecated and it will be removed in the next major release.
https://angular.io/cli/build (search for --rebaseRootRelativeCssUrls
)
So my question is, what is the alternative, is there any other way to get the same result?
Where is Angular json CLI file? The angular-cli. json should be located in the root folder of the project.
--output-hashing all — hash contents of the generated files and append hash to the file name to facilitate browser cache busting (any change to file content will result in different hash and hence browser is forced to load a new version of the file)
Angular CLI uses JSON Schema to enforce the configuration schema. The Angular team created Schematics packages which are used by the CLI. We can configure the options of Schematics packages, as we please, for the root project and internal projects as well.
According to the release notes, the recommended method for transition is using relative URLs in your .scss files. This, to me, seems like a bad idea though. Here’s a comment from the dev team on a bug logged about this issue.
https://github.com/angular/angular-cli/issues/14587#issuecomment-497368020
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With