diff --git a/packages/gatsby-plugin-sharp/package.json b/packages/gatsby-plugin-sharp/package.json index e5222ee49e91c..3d9fa1076fd53 100644 --- a/packages/gatsby-plugin-sharp/package.json +++ b/packages/gatsby-plugin-sharp/package.json @@ -16,7 +16,6 @@ "imagemin": "^6.1.0", "imagemin-mozjpeg": "^8.0.0", "imagemin-pngquant": "^6.0.1", - "imagemin-webp": "^5.1.0", "lodash": "^4.17.15", "mini-svg-data-uri": "^1.2.3", "potrace": "^2.1.6", diff --git a/packages/gatsby-plugin-sharp/src/process-file.js b/packages/gatsby-plugin-sharp/src/process-file.js index db595f828d716..e198466b13108 100644 --- a/packages/gatsby-plugin-sharp/src/process-file.js +++ b/packages/gatsby-plugin-sharp/src/process-file.js @@ -6,7 +6,6 @@ const duotone = require(`./duotone`) const imagemin = require(`imagemin`) const imageminMozjpeg = require(`imagemin-mozjpeg`) const imageminPngquant = require(`imagemin-pngquant`) -const imageminWebp = require(`imagemin-webp`) const { healOptions } = require(`./plugin-options`) const { SharpError } = require(`./sharp-error`) const { cpuCoreCount, createContentDigest } = require(`gatsby-core-utils`) @@ -169,11 +168,6 @@ exports.processFile = (file, transforms, options = {}) => { return transform } - if (transformArgs.toFormat === `webp`) { - await compressWebP(clonedPipeline, outputPath, transformArgs) - return transform - } - try { await clonedPipeline.toFile(outputPath) } catch (err) { @@ -228,20 +222,6 @@ const compressJpg = (pipeline, outputPath, options) => .then(imageminBuffer => fs.writeFile(outputPath, imageminBuffer)) ) -const compressWebP = (pipeline, outputPath, options) => - pipeline.toBuffer().then(sharpBuffer => - imagemin - .buffer(sharpBuffer, { - plugins: [ - imageminWebp({ - quality: options.webpQuality || options.quality, - metadata: options.stripMetadata ? `none` : `all`, - }), - ], - }) - .then(imageminBuffer => fs.writeFile(outputPath, imageminBuffer)) - ) - exports.createArgsDigest = args => { const argsDigest = createContentDigest(args) diff --git a/packages/gatsby/src/schema/__tests__/fixtures/kitchen-sink.json b/packages/gatsby/src/schema/__tests__/fixtures/kitchen-sink.json index a412e7d84331e..183535aaf2f1c 100644 --- a/packages/gatsby/src/schema/__tests__/fixtures/kitchen-sink.json +++ b/packages/gatsby/src/schema/__tests__/fixtures/kitchen-sink.json @@ -380,10 +380,6 @@ "name": "imagemin-pngquant", "version": "^6.0.0" }, - { - "name": "imagemin-webp", - "version": "^5.0.0" - }, { "name": "lodash", "version": "^4.17.10"