johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building
MIT License
1.96k stars 135 forks source link

Expose glob options to distinguish files and directories #196

Open Bilge opened 3 years ago

Bilge commented 3 years ago

Feature Proposal

To facilitate filtering files vs directories, exposing glob options is essential. The underlying glob library has an option called onlyFiles but this is not available via this plug-in. It is not possible to distinguish files and directories using glob patterns alone.

Feature Use Case

glob('*') should be able to match only files, without manually excluding every directory by name. Sometimes it is possible to distinguish files from directories if we can assume files always contain a dot (.) and directories never do (glob('*.*')), but this is not always the case and never guaranteed.