nicolashmln / strapi-plugin-responsive-image

Custom responsive image formats for https://strapi.io
154 stars 28 forks source link

Doesn't work in a Typescript project #29

Closed ciriousjoker closed 1 year ago

ciriousjoker commented 1 year ago

The installation instructions don't work because the .js file isn't detected, even though modifying it forces a recompilation.

ciriousjoker commented 1 year ago

Fixed it:

const imageManipulation = require("strapi-plugin-responsive-image/server/services/image-manipulation");

// console.log("FOUND");
export default (plugin) => {
  plugin.services["image-manipulation"] = imageManipulation();

  // console.log("LOADED");
  return plugin;
};

Also, the brackets are necessary, otherwise you get an error message like "isImage is not a function".


I would have closed this, but changing the installation instructions with a bit more information might be helpful.

nicolashmln commented 1 year ago

Installation instruction updated, thanks