10000 Error in `lastRun()` api docs. · Issue #2315 · gulpjs/gulp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Error in lastRun() api docs. #2315
Closed
@TheDancingCode

Description

@TheDancingCode

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0