ember-cli-brotli

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i ember-cli-brotli

Weekly Downloads

124

Version

1.0.0

License

MIT

Unpacked Size

3.19 kB

Total Files

3

Last publish

Collaborators

  • felixbuenemann