Repository navigation
build does not take into account folders when dealing with svg #12186
Description
Activity
- addedneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is needed
on Sep 6, 2018 Had a look and can confirm that I see the 1x1 (square) ES flag instead of the 4x3 (rectangular) one, while the source CSS rule should load the 4x3 one:
.flag-icon-es { background-image: url(../flags/4x3/es.svg); }I think this is because of bad/missing duplicate handling in our CSS pipeline.
- addedfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyand removedneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is needed
on Sep 7, 2018 @filipesilva This is due to
Line 74 in f7f1d13
filename: `[name]${hashFormat.file}.[ext]`,
we can add[path]or something similar but it will be a breaking change as the output structure won't be flat anymore.This is an issue for me too. I'm using ag-grid and the only way (without ejecting webpack config) is to have multiple folders of icons, named the same but with different colors.
e.g. I have light and dark folders
url(./material-icons-dark/menu.svg)
url(./material-icons-light/menu.svg)In previous version of cli (6.1.2), these svg icons were inlined which worked.
With cli 7.0, they are not inlined and only one of the two icons is output in the dist folder.Here's a reference to the ag grid icon theme issue ag-grid/ag-grid#2151
Hoping to show this issue might have a higher frequency than as tagged.
You can set
outputHashingtomedia. This was the default in the past and will prevent identically named files from overwriting each other (unless the content is identical which is actually favorable).Reacted by John ZahkaReacted by Matthew RadcliffeReacted by Matthew Radcliffe, Oleksandr Rodik and Maksym Humeniuk- addedneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is needed
on May 27, 2020 - removedneeds: investigationRequires some digging to determine if action is neededRequires some digging to determine if action is needed
on Jan 22, 2021 I don't see how comments here resolve #19850, which was closed as duplicate of this, while it's only a special case of #19850.
Kindly see #12186 (comment) for a workaround.
I don't see how comments here resolve #19850, which was closed as duplicate of this, while it's only a special case of #19850.
Kindly see #12186 (comment) for a workaround.
How can I set
outputHashingtomediaforng serve? I don't want to runng serve --prod.You can set any option, in the options section.
"build": { "builder": "@angular-devkit/build-angular:browser", "options": { ... "outputHashing": "media" }, "configurations": { "production": { ... } } },
It doesn't work there, at least for
ng serve. However, it applies forng serve --prod, which I didn't want to use. But even this doesn't help. I'm receiving this in console.Warning: 'outputHashing' option is disabled when using the dev-server. ... Warning: Conflict: Multiple assets emit different content to the same filename logo.pngI also tried to set it in
serveoptions, but it's not allowed there.- added 2 commits that reference this issue
on Jan 28, 2021 angular-automatic-lock-bot commented
on Feb 28, 2021 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Feb 28, 2021

Bug Report or Feature Request (mark with an
x)Command (mark with an
x)Versions
Windows 10
Repro steps
In
angular.json, I added the CSS:In
app.component.htmlRun the app
The log given by the failure
N/A
Desired functionality
The spanish flag is interpreted as:
because the size of
es.svgis more than 10KB. The issue is that the library has severales.svgfiles. In my case this is not the one referenced by the CSS.After the
ng buildcommand, thedistfolder selects the firstes.svgand not both.Mention any other details that might be useful
You see visually the issue at https://stackoverflow.com/questions/52192974/angular-data-urls-processing/52194037