Skip to content

Plugins ​

Every plugin is its own package under the @zilero scope: install only what the build uses.

sh
npm install --save-dev gulp @zilero/gulp-scss-compiler @zilero/gulp-css-squeezer

Compile ​

PluginDoesReplaces
pug-compilerPug templates to HTML, with data per file; partials are skipped.gulp-pug
scss-compilerSCSS and indented Sass to CSS with sass-embedded, source maps kept.gulp-sass

Optimize ​

PluginDoesReplaces
html-squeezerMinifies HTML with html-minifier-next presets.gulp-htmlmin
css-squeezerMinifies, prefixes and lowers CSS for your browsers with Lightning CSS.gulp-clean-css, gulp-autoprefixer
js-squeezerMinifies JavaScript with terser, source maps chained.gulp-terser, gulp-uglify
image-squeezerOptimizes images, converts to WebP and AVIF, resizes for srcset, with sharp.gulp-imagemin, gulp-webp
font-switcherConverts fonts to woff2, woff, ttf, eot and svg, with glyph subsetting.gulp-ttf2woff2, gulp-fontmin

Transform ​

PluginDoesReplaces
file-concatJoins files into one, in the order you set, with a header and footer.gulp-concat, gulp-header
text-replaceReplaces text with strings, regular expressions or async functions.gulp-replace, gulp-header
refilenameRenames files: a name, a prefix or suffix, an extension, a folder, a function.gulp-rename
asset-revisionContent hashes in asset names, references rewritten, a manifest.gulp-rev, gulp-rev-rewrite
archive-creatorPacks the stream into a zip, tar or tar.gz archive.gulp-zip, gulp-tar

Route and filter ​

PluginDoesReplaces
conditionalSends each file through the first branch whose condition holds for it.gulp-if
file-excludeDrops files by glob, regular expression, size or predicate.gulp-filter, gulp-ignore
file-changedLets through only the files that changed since the last build.gulp-changed, gulp-newer
folder-cloneCopies every file into extra folders in one pass.gulp-clone

All of them are built with the plugin factory, which you can use for your own.

Released under the MIT License.