I\'m building a site with react and webpack. When I build the app with webpack and try to include images, the images are written to the build folder along with the other ass
You could try setting the name option for file-loader, as well as output.publicPath
.
output: {
path: 'build/',
file: 'bundle.js',
publicPath: '/assets'
}
...
{
test: /\.(png|jpg)$/,
loader: 'file-loader?name=/img/[name].[ext]'
}
Then the resolved url in your require will be:
/assets/img/news-feed-icon.png