Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-gzip-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-gzip-preprocessor

A gzip preprocessor for Karma

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

karma-gzip-preprocessor NPM version

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.js
module.exports = function(config) {
  config.set({
    files: [
      'src/**/*.test.js'
    ],
    // The plugins config property is optional, but if it is included it must include 'karma-gzip-preprocessor'
    plugins: [
      'karma-gzip-preprocessor',
    ],
    preprocessors: {
      'src/**/*.js': ['gzip'],
      // The `gzip` preprocessor should always be the last preprocessor
      '*.coffee': ['coffee', 'gzip'],
    },
  });
};

Verify your assets are gzipped when you see output simmilar to the following:

$ karma start

INFO [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)

Keywords

FAQs

Package last updated on 03 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc