1.0.0 • Published 2 years ago

ember-cli-brotli v1.0.0

Weekly downloads
111
License
MIT
Repository
github
Last release
2 years ago

ember-cli-brotli

An ember-cli add-on to compress assets using brotli.

This is a fork of ember-cli-gzip.

Note: If you use the ember-deploy addon, just use their brotli plugin: https://www.npmjs.com/package/ember-cli-deploy-brotli

Note: This addon is only useful for production builds and requires a webserver that can serve precompressed assets, like NGINX with the ngx_brotli module and brotli_static enabled for asset paths.

This is more of a low-level addon for custom deployments.

Install

npm install --save-dev ember-cli-brotli

By simply including this add on, js and css assets will automatically be compressed with brotli on production builds.

Options

For more control, you can define options in your app's Brocfile.js:

var app = new EmberApp({
  brotli: {
    // options
  }
});
  • enabled : (Default true in production environment)
  • extensions : Array of file extentions that should be compressed. (Default ['js', 'css'])
  • keepUncompressed: Whether the uncompressed versions of the files should be kept. (Default false)
  • appendSuffix: Whether to append the .br suffix. (Default true)
  • XXX: Where XXX comes from BrotliOptions. You can also use short-hand options, eg. params: {[zlib.constants.BROTLI_PARAM_QUALITY]: 4} becomes quality: 4 (same as old iltorb compression options).

References