Answer the question
In order to leave comments, you need to log in
Why does the copy webpack plugin add **/* to the end of the path?
Hello! Trying to understand why the copy webpack plugin adds **/* to the end of the path and solve the unable to locate error accordingly
Here is the code:
new CopyWebpackPlugin({
patterns: [
{ // Ругается именно на этот путь
context: path.resolve(__dirname),
from: 'src/assets/images',
to: 'dist/images'
},
{
context: path.resolve(__dirname),
from: 'src/assets/favicon.ico',
to: 'dist/favicon.ico'
},
{
context: path.resolve(__dirname),
from: 'web.config',
to: 'dist/web.config'
}
]
})
Answer the question
In order to leave comments, you need to log in
You need to add the noErrorOnMissing: true option, which will tell the collector if the folder is empty, then skip it and don't generate an error.
{
//Copy assets
from: path.resolve(__dirname, "./src/assets/images"),
to: path.resolve(__dirname, "./dist/images"),
noErrorOnMissing: true,
}
Your folder is empty simply.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question