@zilero/gulp-conditional
v1.0.4
Published
A Gulp plugin for executing different functions based on specified conditions, enabling flexible task management in Gulp workflows.
Maintainers
Readme
🔀 Powerful Gulp plugin for conditional stream processing.
Installation • Options • Example
✨ Features
- 🔄 Conditional stream processing
- 🎯 Multiple condition handlers
- 📝 TypeScript support
- 🚀 Stream-based processing
- 💡 Default fallback handler
- 🛠️ Flexible condition system
🚀 Installation
npm install @zilero/gulp-conditional --save-dev
# or
yarn add @zilero/gulp-conditional --dev
# or
pnpm add @zilero/gulp-conditional --save-dev⚙️ Options
handlers
- Type:
Array<{ condition: boolean | () => boolean, handler: () => Transform }> - Required:
true - List of condition-handler pairs
defaultHandler
- Type:
() => Transform - Required:
false - Default handler if no conditions match
📝 Example
gulp.task('advanced-conditional', () => {
return gulp.src('src/**/*')
.pipe(GulpConditional({
handlers: [
{
condition: () => process.env.NODE_ENV === 'production',
handler: () => GulpJsSqueezer({
minifyOptions: {
compress: true
}
})
},
{
condition: () => process.env.NODE_ENV === 'development',
handler: () => GulpFileExclude({
patterns: ['.min.']
})
}
],
defaultHandler: () => GulpFileExclude({
patterns: ['.test.']
})
}))
.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
