nuxt-brotli

This Nuxt.js module compresses assets with Brotli compression algorithm using `iltorb]` library for serving it with `ngx_brotli`
4,291 19
Install
npm install nuxt-brotli
Latest Version:1.1.7
License:MIT
Last Updated:Apr 28, 2022
Links: GitHub  ·  npm
Maintainer: daliborgogic

nuxt-brotli

This Nuxt.js module compresses assets with Brotli compression algorithm using iltorb library for serving it with ngx_brotli.

Installation

$ npm i nuxt-brotli

Usage

Add nuxt-brotli to modules section of nuxt.config.js

{
  modules: ['nuxt-brotli']
}

Arguments:

  • asset: The target asset name. Defaults to '[path].br[query]'.
    • [file] is replaced with the original asset file name.
    • [fileWithoutExt] is replaced with the file name minus its extension, e.g. the style of style.css.
    • [ext] is replaced with the file name extension, e.g. the css of style.css.
    • [path] is replaced with the path of the original asset.
    • [query] is replaced with the query.
  • test: All assets matching this RegExp are processed. Defaults to /\.(js|css|html|svg)$/.
  • threshold: Only assets bigger than this size (in bytes) are processed. Defaults to 0.
  • minRatio: Only assets that compress better that this ratio are processed. Defaults to 0.8.
  • deleteOriginalAssets: remove original files that were compressed with brotli. Default: false

Optional arguments for Brotli (see iltorb doc for details):

  • mode: Default: 0,
  • quality: Default: 11,
  • lgwin: Default: 22,
  • lgblock: Default: 0,
  • size_hint: Default: 0,
  • disable_literal_context_modeling: Default: false

License

Nuxt.js

iltorb

brotli plugin for webpack

MIT

Related Packages

nuxt-define

One utility function for module authors to define compiler constants for all bui...

13,412,511
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0
nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention

6,263,746 91
@bg-dev/nuxt-naiveui

Unofficial Naive UI module for Nuxt

144,316 187
@ztl-uwu/nuxt-content

Write your content inside your Nuxt app

34,108

Version History

Version Released License
1.1.7 MIT
1.1.5 MIT
1.1.4 MIT
1.1.1 MIT
1.1.0 MIT