CopyWebpackPlugin - ignore a folder
New versions of CopyWebpackPlugin have changed the way of ignoring files.
new CopyWebpackPlugin({
patterns: [{
from: defaultSourcePath,
globOptions: {
ignore: [
'**/css/my.css',
'**/js/my.js',
'**/index.html'
]
}
}]
})
Try this:
ignore: ['img/folder/**/*']
This will not copy the entire img/folder
.
Remember to clear your destination folder before running your webpack.