webpack-cleanup-plugin icon indicating copy to clipboard operation
webpack-cleanup-plugin copied to clipboard

How to ensure .gitignore file is preserved?

Open qodesmith opened this issue 8 years ago • 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

qodesmith avatar Dec 18 '17 14:12 qodesmith

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']
})

Moghul avatar Feb 26 '18 10:02 Moghul