Answer the question
In order to leave comments, you need to log in
How to use file-loader for pictures?
All sources are in src/app. I have a basic configuration for pictures:
{
test: /\.(webp|png|jpg|jpeg|gif)$/,
exclude: excludeImages(FAVICON_FILENAMES),
use: [
{
loader: 'file-loader',
options: {
name: `${staticDir}/images/[hash].[ext]`,
},
},
],
},
{
test: /\.(webp|png|jpg|jpeg|gif)$/,
exclude: excludeImages(FAVICON_FILENAMES),
include: [
path.resolve(__dirname, 'src/app/special-images'),
],
use: [
{
loader: 'file-loader',
options: {
name: `${staticDir}/special-images/images/[hash].[ext]`,
},
},
],
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question