Answer the question
In order to leave comments, you need to log in
How to make subcategories of pictures in dist folder?
{
test: /\.(jpg|svg|png|gif|webp)$/,
use:[ {
loader: 'file-loader',
options: {
name: '[name].[ext]', // version 1
// name: '[path][name].[ext]', // version 2
outputPath: 'img',
publicPath: '/img',
postTransformPublicPath: (p) => `__webpack_public_path__ + ${p}`,
}
Answer the question
In order to leave comments, you need to log in
options: {
name: '[path][name].[ext]',
context: 'src/img',
outputPath: 'img',
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question