cloudinary-community / netlify-plugin-cloudinary

Supercharge images on your Netlify site with Cloudinary!
https://netlify.cloudinary.dev/
MIT License
42 stars 18 forks source link

[Feature] Warn if cloudname configs are different #102

Open colbyfayock opened 1 year ago

colbyfayock commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe.

You can configure cloud name in both an environment variable and in a plugin input - if both are different values, we should warn in the logs that this is the case to help debugging.

nishant05gaurav commented 1 month ago

Hey, please allow me to fix this

module.exports = {
  onPreBuild: ({ inputs, utils }) => {
    const envCloudName = process.env.CLOUDINARY_CLOUD_NAME;
    const inputCloudName = inputs.cloudName;

    if (envCloudName && inputCloudName && envCloudName !== inputCloudName) {
      utils.build.warn(`Cloudinary cloud names differ: Environment Cloud Name is "${envCloudName}" but Plugin Cloud Name is "${inputCloudName}".`);
    }
  },
};
colbyfayock commented 1 month ago

all yours!

nishant05gaurav commented 1 month ago

thankyou!!