ElMassimo / vite-plugin-image-presets

🖼 Image Presets for Vite.js apps
https://image-presets.netlify.app/
MIT License
250 stars 5 forks source link

fix: recreate API when Vite command changes #28

Open XiNiHa opened 1 year ago

XiNiHa commented 1 year ago

Currently, this plugin doesn't work well in build when used with Astro. It's because the configResolved hook gets called three times: first with the serve command, then two builds for server and client. This breaks the current logic of caching the api object, since the command changes to build after the first serve step, while the isBuild property should change as the command parameter changes. This PR fixes the issue by checking if the command has changed.

netlify[bot] commented 1 year ago

Deploy Preview for image-presets ready!

Name Link
Latest commit 8d36764b1ecdf93450e02c635cb7ed37f63a4577
Latest deploy log https://app.netlify.com/sites/image-presets/deploys/64be6013b0d77800086853cc
Deploy Preview https://deploy-preview-28--image-presets.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.