Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird errorOnUnusedConfig behavior #96

Open
marcospgp opened this issue Apr 28, 2018 · 0 comments
Open

Weird errorOnUnusedConfig behavior #96

marcospgp opened this issue Apr 28, 2018 · 0 comments

Comments

@marcospgp
Copy link

Without errorOnUnusedConfig: false, I got the following error:

 Error in plugin "gulp-responsive"
Message:
    Available images do not match the following config:
  - `**/*`

With errorOnUnusedConfig: false, the error disappears, and ALL the images go through, except some get skipped because of enlargement.

My guess is that the skip on enlargement is triggering the unused config error by mistake.

Here's the task I'm using (with the errorOnUnusedConfig: false):

gulp.task('image:build', () => {
  return gulp.src(gulpPaths.src.img)
    .pipe(plumber())
    .pipe(changed(gulpPaths.build.img))
    .pipe(responsive({
      // Limit image size to 600px for both width an height
      // (example: 300x1200 image gets resized to 150x600)
      '**/*': {
        width: 600,
        height: 600,
        min: false,
        max: true, // Use width and height as max values, preserve aspect ratio
        quality: 80, // Only applies to JPEG, WebP and TIFF
        progressive: true,
        compressionLevel: 6,
        withMetadata: false,
        withoutEnlargement: true,
        skipOnEnlargement: false
      }
    }, {
      errorOnEnlargement: false,
      errorOnUnusedConfig: false
    }))
    .pipe(imagemin([
      imagemin.gifsicle({ interlaced: true }),
      imagemin.jpegtran({ progressive: true }),
      imagemin.optipng({ optimizationLevel: 6 }),
      imagemin.svgo({
        plugins: [
          { removeViewBox: false },
          { cleanupIDs: true }
        ]
      })
    ]))
    .pipe(gulp.dest(gulpPaths.build.img))
    .pipe(reload({ stream: true }));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant