karma-gzip-preprocessor
A Karma preprocessor for compressing test assets.
Particularly handy when working with large test bundles and remote browser-cloud services like Browserstack or Saucelabs.
Installation
npm install karma-gzip-preprocessor --save-dev
Requirements
Since karma-gzip-preprocessor has a minimum requirement of karma v3.1.0.
For older versions of karma, see the README for karma-gzip v2.
Configuration
To enable gzip compression, all you need to do is add gzip
as a preprocessor in your karma config.
// karma.conf.jsmodule {config;};
Verify your assets are gzipped when you see output simmilar to the following:
$ karma startINFO [preprocessor.gzip]: compressed /MyProject/src/polyfills.js [2MB -> 437KB]INFO [preprocessor.gzip]: compressed /MyProject/src/index.test.js [5MB -> 1MB]
License
MIT (http://www.opensource.org/licenses/mit-license.php)