When Strapi does a file update, it doesn't provide the URL or MIME props needed to [re]-generate a placeholder. I've added a bit of extra code to generatePlaceholder to fetch the original file's info and to populate these fields if they are missing before being fed to canGeneratePlaceholder, allowing placeholders to be updated when a file is updated, not just created.
I've also fixed a type error in canGeneratePlaceholder should mimeTypes.lookup fail - something that was causing 500 errors when updating a file - and I've updated package.json to also support Node 18.x, as the plugin seems to work without issue.
When Strapi does a file update, it doesn't provide the URL or MIME props needed to [re]-generate a placeholder. I've added a bit of extra code to generatePlaceholder to fetch the original file's info and to populate these fields if they are missing before being fed to canGeneratePlaceholder, allowing placeholders to be updated when a file is updated, not just created.
I've also fixed a type error in canGeneratePlaceholder should mimeTypes.lookup fail - something that was causing 500 errors when updating a file - and I've updated package.json to also support Node 18.x, as the plugin seems to work without issue.
Fixes #2, #6 and #11