nuxt / image

Plug-and-play image optimization for Nuxt applications.
https://image.nuxt.com
MIT License
1.33k stars 270 forks source link

Document SVG support for AWS Amplify #1173

Open leynier opened 9 months ago

leynier commented 9 months ago

PNG images work correctly. For example, for the file:

https://nuxt.educup.io/img/achievement-1.png

Through the image module, it also works correctly:

https://nuxt.educup.io/_amplify/image?url=/img/achievement-1.png&w=1280&q=100

But for the SVG file:

https://nuxt.educup.io/img/logo-white-tm.svg

The URL provided by the image module:

https://nuxt.educup.io/_amplify/image?url=/img/logo-white-tm.svg&w=1280&q=100

Raises the "SVG files are not allowed" error.

JhumanJ commented 9 months ago

This is probably related to dangerouslyAllowSVG params on https://docs.aws.amazon.com/amplify/latest/userguide/image-optimization.html

JhumanJ commented 9 months ago

Fixed with the right config:

export default defineNuxtConfig({
    nitro: {
        awsAmplify: {
            imageSettings: {
                dangerouslyAllowSVG: true
            }
        }
    }
})
leynier commented 9 months ago

It works fine with that configuration, thanks a lot @JhumanJ