gpbl/webpack-cleanup-plugin

How to ensure .gitignore file is preserved?

qodesmith opened this issue · 1 comments

In my webpack file I have:

new WebpackCleanupPlugin({
  exclude: [path.resolve(__dirname, 'dist/*.gitignore')]
})

I've also tried a few other variations of the single element in the exclude array:

  • 'dist/.gitignore'
  • 'dist/*.gitignore'

Each time I run a build, the .gitignore file is deleted. Any thoughts?

Thing Version
webpack-cleanup-plugin 0.5.1
Node 9.2.0
webpack 3.10.0

Perhaps I'm mistaken but I understood that the excludes would all be part of your output path. It's how I'm treating my excludes.

Try

new WebpackCleanupPlugin({
  exclude: ['*.gitignore']
})