chladog / payload-webp

payloadcms/payload plugin for automatic image conversion to webp format.
https://www.npmjs.com/package/payload-webp
GNU General Public License v3.0
44 stars 5 forks source link

Please update documentation #7

Closed Etheliene closed 2 years ago

Etheliene commented 2 years ago

So far I have figured out that the plugin makes the following assumptions to my codebase:

  1. The "uploads" collection needs staticDir to be defined or generation will fail
    error - unhandledRejection: TypeError: Cannot read properties of undefined (reading 'indexOf')
    at payload-webp\lib\WebpCollection.js:113:45
  2. payload.config.ts|js needs at least [admin.](webpack: (config) => config,) if you don't need a custom config or build will fail, as described in #6
TypeError: Cannot read properties of undefined (reading 'webpack')
\payload-webp\lib\Plugin.js:273
var incomingWebpackConfig = this.payloadConfig.admin.webpack;

Please update documentation

chladog commented 2 years ago

Hi Etheliene,

  1. staticDir* is required at any payload upload collection, as stated here: https://payloadcms.com/docs/upload/overview ; thus I believe it should be handled by this plugin.
  2. Fixed by f63279bdfe0f83d8f5a23a146f3b4ba78f669754