webpack-contrib/copy-webpack-plugin

Help: Could you tell me why this plugin can not ignore the corresponding files

luckyjolly opened this issue · 2 comments

new CopyWebpackPlugin({
  patterns: [{
    from: path.resolve(__dirname, '../static'),
    to: 'static',
    globOptions: {
      ignore: ['.*'] 
    }
  }]
})

copy-webpack-plugin version: 9.0.1

At frist, I set the value of 'igore' option to ['.']. I just wanted to ignore the files start with dot. But failed. The result is shown in f ollowing image:
image
As the result, those files 'static/.gitkeep' and 'static/.html' was copyed to the directory 'dist/statc/'.
Then I changed the value of 'ingore' to ['.
', '.gitkeep'], also failed.
Then I changed the value of 'ingore' to ['.', '**.gitkeep'], and I igored the file '.gitkeep' successfully.
At last, I also tried this values ['
.'], ['.'], ['.'], ['.*'], all failed. And now, I can't understand the following rules.
image

Ask this in globby/fast-glob package, we use it under the hood

same problem in 9.0.1