I am despritly trying to make make jhipster to serve static files, and it does but only to some extend, it seams that whatever the default configuration of jhipster app is, it is not able neither to retrieve any images througn the old fashioned src attribute. [edit]Sorry svg files load properly i just have written the path incorectly. I tried to configure my own resource handler
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry
.addResourceHandler("/**")
.addResourceLocations("/");
super.addResourceHandlers(registry);
}
But nothing seems to change, does anyone knows how to change the configuration so it would work properly.
[edit] I would be fine with this approuch but my problem is that i can`t load the image urls into backgound property dynamicly, This is what i am trying to achive
<div [ngStyle]="{background: 'url('+service.productImageUri+') no-repeat center top'}"></div>
[edit]My problem is that if this style was written in sass file, then i would get a webpack MD5 hash generated link throgh webpack loader that IS working, but instead , because angular knows nothing about this mechanizm, i get a normal link that DOES NOT work.
Here is the file loader configuration of webpack
test: /\.(jpe?g|png|gif|svg|woff|woff2|ttf|eot)$/i,
loaders: [
'file-loader?hash=sha512&digest=hex&name=[hash].[ext]', {
loader: 'image-webpack-loader',
query: {
gifsicle: {
interlaced: false
},
optipng: {
optimizationLevel: 7
}
}
}
]
}
Does anyone know how to make webpack cooperate with angular 2 so i would get the prepared link instead of the standart when i load the image url dynamically, or at least do something that would prevent webpack from blocking request from reaching to spring boot resource handler.