PlayForm / Compress

🗜️ Compress —
https://playform.github.io/Compress/
Other
510 stars 12 forks source link

Feature request: ld-json compression in readme / examples or enabled by default #81

Closed xfenix closed 1 year ago

xfenix commented 1 year ago

Hey, great project, thanks for your work! I'm here for feature request. Currently, there is no ld-json compression by default. It may be not very needed for many users, but it may help someone. As I found out here, https://github.com/terser/html-minifier-terser/issues/34 it easily enabled by { processScripts: ['application/ld+json'] } configuration option. I spent some time in your README and finally be able to write something like this

...
    compress({
      html: {
        processScripts: ["application/ld+json"],
      },
    }),
...

And it works. But, this leads me to the following conclusions. It will be cool to do something of or both:

Example of compressed built HTML with untouched ld-json section (if anyone wants to see how it looks):

image
NikolaRHristov commented 1 year ago

It will be added by default! Expect it in 1.1.33

NikolaRHristov commented 1 year ago

Fixed in https://github.com/astro-community/astro-compress/releases/tag/v1.1.33