PlayForm / Compress

🗜️ Compress —

Home Page:https://NPMJS.Org/@playform/compress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

xfenix opened this issue · comments

commented

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

It will be added by default! Expect it in 1.1.33