-
Notifications
You must be signed in to change notification settings - Fork 12k
baseHref not resolved in imported scss files #14758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is working as intended. Kindly see #14587 (comment) for more context. |
@alan-agius4 I don't get the point from the #14587 why you have done this? It is not possible to add relative urls in the scss file when you will include shared assets files via glob (https://github.com/angular/angular-cli/wiki/stories-asset-configuration). It was only possible to use absolute urls in the scss file, as you can read here as well: #14587 (comment) As I said, we provide a component library for the hole company by using this concept, that worked since the update to Angular 8. That includes normal fonts and icon font files. This breaking change stops us at the moment to move to Angular 8 for all projects. The CLI (8.0.2) give me So there is no solution for that. The issue can't ignored and closed. |
HI, I think you are trying to use the This option is only available for the Example: "build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
"rebaseRootRelativeCssUrls": true I am not fully aware of the component library that you are using and it's architecture but in generally speaking a library that providing uncompiled SCSS should offer the functionality to configure the paths of the assets location. The most common pattern, is that libraries provide a variable to modify the assets path. bootstrap-sass for example has an Can you kindly go through why do you need the |
Thanks for the hint. Yes I tried it on serve. I tried to check the integration and changes directly. Our company needs to provide different themes for our brands. We deliver standardized components with the library for all brands. The brand can be activate its theme by including the needed scss file only inside its there Angular App. And the core team maintain the style guide and the components. We have applications in a closed intranet or with no internet connection beside public applications, so we are not able to deliver fonts or icons via CDN. There are also themes that uses licenced fonts, that we couldn't put on our CDN. So best approach was to deliver all scss and assets with our lib. Then we are able to update the theme and asses by a library release and the project doesn't need to care about. We use the default Angular Before that for us it was given out of the box, that the Like you, we want that the user of our library needs to configure as less as possible. That was the reason, why it works well with the Angular project / library set up. Of course, to enable the scss part, I wrote a script that puts the scss files beside the final lib after the build is finish before we publish it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: 7.3.9Description
We have an internal library, that provides scss files for the company styles. In one of the files called fonts.scss are references to the corporate fonts. We ship the fonts for internal projects within our library.
🔬 Minimal Reproduction
In the angular.js we copy the fonts to a project by using the following config:
In our fonts.scss we refer to the fonts by:
This works well on ng-serve because the fonts will linked into the root/assets folder correctly. When we add a baseHref in version 7, it was added through
src: url('/assets/fonts/OurFont_W_Rg.eot');
and as result by using a baseHref of "/our-app/" we get the correct resultsrc: url('/our-app/assets/fonts/OurFont_W_Rg.eot');
inside styles.js or styles.css.🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: