@zilero/gulp-file-exclude
v1.0.4
Published
Gulp plugin for excluding files based on patterns
Readme
🚫 Powerful Gulp plugin for excluding files based on patterns and conditions.
Installation • Options • Example
✨ Features
- 📋 Pattern-based exclusion
- 📏 Size-based filtering
- 🔄 Custom exclusion functions
- 📝 TypeScript support
- 🚀 Stream-based processing
- 💡 Progress logging
🚀 Installation
npm install @zilero/gulp-file-exclude --save-dev
# or
yarn add @zilero/gulp-file-exclude --dev
# or
pnpm add @zilero/gulp-file-exclude --save-dev⚙️ Options
patterns
- Type:
(string | RegExp)[] - Required:
false - Default:
[] - Patterns to match for exclusion
size
- Type:
[number?, number?] - Required:
false - Default:
[] - File size limits [min, max] in bytes
onExclude
- Type:
(file: Vinyl) => Promise<boolean> - Required:
false - Custom exclusion function
📝 Example
gulp.task('advanced-filter', () => {
return gulp.src('src/**/*')
.pipe(GulpFileExclude({
patterns: [
'.test.',
/\.spec\./,
'temp-',
/-draft\./
],
size: [
1024, // min 1KB
1048576 // max 1MB
],
logExcluded: true,
onExclude: async (file) => {
// Custom exclusion logic
return file.stat?.size > 5000000; // Exclude files > 5MB
}
}))
.pipe(gulp.dest('dist'));
});🤝 Contributing
If you would like to contribute to the project, please create a pull request or leave feedback. We are always open to new ideas and improvements!
🐛 Issues
Found a bug? Want to request a feature? Please create an issue.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Zilero
