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

[Bug] netlify.toml loadingStrategy is ignored #97

Closed gshel closed 1 year ago

gshel commented 1 year ago

Bug Report

Describe the bug

When a user provides a netlify.toml file k/v pair: plugins.inputs.loadingStrategy: eager it is ignored and instead uses lazy for all img loading attributes.

Is this a regression?

This is not a regression.

Steps To Reproduce the error

  1. Have a Netlify site with the Cloudinary integration enabled
  2. Create a netlify.toml in the site's root dir
  3. Add the following code:
    [[plugins]]
    package = "netlify-plugin-cloudinary"
    [plugins.inputs]
    loadingStrategy = "eager"
  4. Add an image to the site's static resources
  5. Refer to the added image in the src attribute of an html img tag
  6. Save + commit + push all changes
  7. Deploy site with latest changes
  8. Go to site
  9. Right click image and select Inspect to review attributes

Expected behaviour

When inspecting the img's attributes, I expect to see the loading attribute be eager since I specified it in my netlify.toml

Your environment

Additional context

I've got a fix already so will open a PR~