Closed
Description
The lastRun()
api docs contain an error. Under usage, it provides the following recipe:
const { src, dest, lastRun, watch } = require('gulp');
const imagemin = require('gulp-imagemin');
function images() {
return src('src/images/**/*.jpg', { since: lastRun(images) })
.pipe(imagemin())
.pipe(dest('build/img/'));
}
function watch() {
watch('src/images/**/*.jpg', images);
}
exports.watch = watch;
However, running this gives a SyntaxError: Identifier 'watch' has already been declared
. You can't name the function watch
, since watch
is already declared as the gulp command in de destructuring assignment.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
- [Snyk] Upgrade gulp from 4.0.0 to 4.0.2ajesse11x/PowerShell
- [Snyk] Upgrade gulp from 4.0.0 to 4.0.2Matthelonianxl/flight-manual.atom.io
- [Snyk] Upgrade gulp from 4.0.0 to 4.0.2raindigi/cloudcannon-suite
- [Snyk] Upgrade gulp from 4.0.0 to 4.0.2cdcc1969/etherwallet
- [Snyk] Upgrade gulp from 4.0.0 to 4.0.2baophucct/PowerShell
- Bump gulp from 3.9.1 to 4.0.2 in /client-admincompdemocracy/polis
- Bump gulp from 3.9.1 to 4.0.2 in /css/css-writing-modes/tools/generatorsblackzilla2126/wpt
- Bump gulp from 3.9.1 to 4.0.2 in /css/css-writing-modes/tools/generatorstkntjsdw/wpt
- Bump gulp from 3.9.1 to 4.0.2 in /css/css-writing-modes/tools/generatorsExE-Boss/web-platform-tests
- Bump gulp from 3.9.1 to 4.0.2 in /css/css-writing-modes/tools/generatorsMattiasBuelens/wpt
Activity
phated commentedon Apr 27, 2019
Thanks @TheDancingCode! I've rewritten it to export a default task.
63 remaining items