IIS Angular 7 page not loading images after upgrade to Angular 7 from 6
up vote
0
down vote
favorite
After upgrading Angular from 6 to 7 images that are being referenced in css with the rule background-image: url('../../../../../assets/icons/T04_24_edit.svg')
are now being dumped directly into the dist folder when building for prod.
This is the dist folder:
And then my browser doesn't know how to load those svg's because IIS looks for them inside wwwrooot instead of dist:
This looks like some kind of optimization from the new Angular 7 build.
Is there any way I can disable this and revert to the Angular 6 way of using the path specified for images and not doing shady optimizations under the hood ?
asp.net-mvc angular iis webpack upgrade
add a comment |
up vote
0
down vote
favorite
After upgrading Angular from 6 to 7 images that are being referenced in css with the rule background-image: url('../../../../../assets/icons/T04_24_edit.svg')
are now being dumped directly into the dist folder when building for prod.
This is the dist folder:
And then my browser doesn't know how to load those svg's because IIS looks for them inside wwwrooot instead of dist:
This looks like some kind of optimization from the new Angular 7 build.
Is there any way I can disable this and revert to the Angular 6 way of using the path specified for images and not doing shady optimizations under the hood ?
asp.net-mvc angular iis webpack upgrade
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
After upgrading Angular from 6 to 7 images that are being referenced in css with the rule background-image: url('../../../../../assets/icons/T04_24_edit.svg')
are now being dumped directly into the dist folder when building for prod.
This is the dist folder:
And then my browser doesn't know how to load those svg's because IIS looks for them inside wwwrooot instead of dist:
This looks like some kind of optimization from the new Angular 7 build.
Is there any way I can disable this and revert to the Angular 6 way of using the path specified for images and not doing shady optimizations under the hood ?
asp.net-mvc angular iis webpack upgrade
After upgrading Angular from 6 to 7 images that are being referenced in css with the rule background-image: url('../../../../../assets/icons/T04_24_edit.svg')
are now being dumped directly into the dist folder when building for prod.
This is the dist folder:
And then my browser doesn't know how to load those svg's because IIS looks for them inside wwwrooot instead of dist:
This looks like some kind of optimization from the new Angular 7 build.
Is there any way I can disable this and revert to the Angular 6 way of using the path specified for images and not doing shady optimizations under the hood ?
asp.net-mvc angular iis webpack upgrade
asp.net-mvc angular iis webpack upgrade
edited 12 hours ago
Goncalo Peres
9211311
9211311
asked Nov 19 at 11:16
Hazerd
188216
188216
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
To place static assets in dist folder, which is created after production build - you need add appropriate path to projects.your-project-name.architect.build.options.assets
in angular.json
file.
add a comment |
up vote
0
down vote
Apparently what made it work was changing the url in the scss files from background-image: url('../../../../../assets/icons/T04_24_edit.svg')
to background-image: url('/assets/icons/T04_24_edit.svg')
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
To place static assets in dist folder, which is created after production build - you need add appropriate path to projects.your-project-name.architect.build.options.assets
in angular.json
file.
add a comment |
up vote
0
down vote
To place static assets in dist folder, which is created after production build - you need add appropriate path to projects.your-project-name.architect.build.options.assets
in angular.json
file.
add a comment |
up vote
0
down vote
up vote
0
down vote
To place static assets in dist folder, which is created after production build - you need add appropriate path to projects.your-project-name.architect.build.options.assets
in angular.json
file.
To place static assets in dist folder, which is created after production build - you need add appropriate path to projects.your-project-name.architect.build.options.assets
in angular.json
file.
answered Nov 19 at 11:50
magos
1,67131837
1,67131837
add a comment |
add a comment |
up vote
0
down vote
Apparently what made it work was changing the url in the scss files from background-image: url('../../../../../assets/icons/T04_24_edit.svg')
to background-image: url('/assets/icons/T04_24_edit.svg')
add a comment |
up vote
0
down vote
Apparently what made it work was changing the url in the scss files from background-image: url('../../../../../assets/icons/T04_24_edit.svg')
to background-image: url('/assets/icons/T04_24_edit.svg')
add a comment |
up vote
0
down vote
up vote
0
down vote
Apparently what made it work was changing the url in the scss files from background-image: url('../../../../../assets/icons/T04_24_edit.svg')
to background-image: url('/assets/icons/T04_24_edit.svg')
Apparently what made it work was changing the url in the scss files from background-image: url('../../../../../assets/icons/T04_24_edit.svg')
to background-image: url('/assets/icons/T04_24_edit.svg')
answered Nov 19 at 12:13
Hazerd
188216
188216
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373471%2fiis-angular-7-page-not-loading-images-after-upgrade-to-angular-7-from-6%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown