robcresswell / nuxt-compress

A simple static asset compression module for Nuxt that runs Gzip and Brotli compression during the build process
https://www.npmjs.com/package/nuxt-compress
MIT License
102 stars 9 forks source link

Allow brotli compression to be disabled #10

Closed azrikahar closed 4 years ago

azrikahar commented 4 years ago

Can we add a flag to make it so .br files won't be generated? This is mainly because recently I was pushing the generated files in Nuxt to the production server and since the Nginx doesn't have Brotli enabled, the .br files are not being utilized. Additionally since Brotli isn't prominently used atm (do correct me if I'm wrong), perhaps having this option available isn't too niche after all.

Proposed config:

module.exports = {
  modules: ["nuxt-compress"],
  "nuxt-compress": {
    brotli: {
      enabled: false
    }
  }
};

Was thinking of simply brotli: false but felt like it might not be easily understandable and/or confusing.

robcresswell commented 4 years ago

Hey @azrikahar, sorry I never replied to this.

The plugin is so minimal, I'd prefer to keep it as it is, rather than start adding customisation. Brotli has fairly wide support now (see https://caniuse.com/#feat=brotli), so there doesn't seem to be much of a good reason not to use it, unless you don't have control over your static asset host.

There are also other nuxt compression plugins out there that can do gzip only.

azrikahar commented 4 years ago

Hi @robcresswell, no worries.

I totally agree with your points. From the point in time of opening this issue until this day, I've surely became more aware on how scary feature creep can be haha.

Really appreciate the reply. I'll close this issue now. Cheers!

robcresswell commented 4 years ago

🙇🏻‍♂️