@ideasonpurpose/gulp-task-clean
v0.1.2
Published
A gulp 4 task to clean build artifacts
Downloads
3
Readme
Gulp Task: Clean
Create a very simple pre-configured Gulp 4 task to remove files. Most often used to clear generated artifacts before starting a new build.
Installation
$ yarn add @ideasonpurpose/gulp-task-clean
or
$ npm install @ideasonpurpose/gulp-task-clean
Usage
Basic
Call the create
method directly on the import. In most cases, just trust the defaults and go:
const clean = require("@ideasonpurpose/gulp-task-clean").create();
// Export to make the task publicly callable
exports.clean = clean;
Custom options
The create
method accepts one configuration object. This module accepts one property:
- target
A glob string or array of glob-strings. Defaults todist
Passed directly todel
Example use
An example which cleans both the dist
directory and all *.zip
files from snapshots
before running a build task might look like this:
const gulp = require("gulp");
const clean = require("@ideasonpurpose/gulp-task-clean").create({
target: ["dist", "snapshots/**/*.zip"]
});
// Run this in series as part of a pipeline and only the one build task
exports.build = gulp.series(clean, gulp.parallel(styles, imaagemin));