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 Nov 22 at 15:21
Goncalo Peres
1,2351314
1,2351314
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,69831838
1,69831838
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 |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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