Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xfenix opened this issue Feb 15, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@xfenix
Copy link

xfenix commented Feb 15, 2023

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, terser/html-minifier-terser#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:

  • add in your README example of options override (because, in my opinion, it not so obvious despite the phrase «You can override any of the default options from the configurations of»). It is easy to achieve and increase ease of usage of your project. Yeah, you may say this is basic thing for the software engineer to be the partially detective, but I think more obvious path in README don't kill this vibe
  • add by default this option (it wouldn't harm anyone, I think?)

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

@NikolaRHristov NikolaRHristov added the enhancement New feature or request label Feb 15, 2023
@NikolaRHristov
Copy link
Member

It will be added by default! Expect it in 1.1.33

@NikolaRHristov
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants