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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…