Détail du package

karma-rollup-plugin

TrySound556MIT0.2.4

A Karma preprocessor plugin to offer seamless integration with Rollup

karma, karma-plugin, karma-preprocessor, modules

readme

karma-rollup-plugin Build Status

A Karma preprocessor plugin to offer seamless integration with rollup

This plugin is a Karma preprocessor to compile and bundle your spec entry point on the fly. It works seamless with all Rollup plugins.

Features

  • supports Rollup by default
  • supports both Babel and Buble as the ES2015 compiler
  • sourceMap
  • recompiling of dependencies when files changes
  • ES3, ES5, ES2015, ES2016, and ES2017 (with Babel or Buble)

Installation

The easiest way is to keep karma-rollup-plugin as a devDependency. You can simple do it by:

npm i karma-rollup-plugin --save-dev

Configuration

Note! As a rule of thumb, use of umd format doesn't make sense in tests, and will throw a warning without a module name.

Following code shows the default configuration

// karma.conf.js
module.exports = function (config) {
  config.set({
    preprocessors: {
     'test/**/*.js': ['rollup']
    },
    rollupPreprocessor: {
      // rollup settings. See Rollup documentation
      plugins: [
        buble() // ES2015 compiler by the same author as Rollup
      ],
      // will help to prevent conflicts between different tests entries
      format: 'iife',
      sourceMap: 'inline'
    }
  });
};

See Rollup documentation - JavaScript API for more details.

Why this plugin?

There exist a karma-rollup-preprocessor plugin for Karma, but it contains too many bugs, and doesn't seem to be maintained atm. This plugin try to stay true to the Rollup ecosystem.

changelog

Changelog

0.2.4

  • Fix broken release

0.2.3

  • Remove dead code

0.2.0

  • code stability
  • fixed and added more tests
  • removed dead code
  • updated NPM packages

0.1.11

  • fixed issue where UMD format was set without module name.
  • added tests

0.1.9

  • BC! Merged Rolup and Bundle options into one. The preprocessor now works like Rollup
  • fixed linting issues
  • cleanup

0.1.7

  • cleaned up the source code

0.1.6

  • fixed issures where the code doesn't work at all

0.1.4

  • refactoring done by @TrySound.
  • fixed tests

0.1.3

  • refactoring done by @TrySound.

0.1.1

  • works for NodeJS 0.12, 4, 5, 6
  • refactoring
  • fixed a couple of bugs

0.1.0

  • serious bugs fixed
  • removed ES2015 code form source
  • added test for ES2015 class so we know transpilling works perfectly
  • updated Rollup to v.0.34.0

0.0.8

  • minor refactoring

0.0.7

  • refactored tests. Got rid of Babel

0.0.6

  • fixed nodeJS 0.12 issue
  • updated NPM packages

0.0.5

  • fixed issue #6. Credit: brianmhunt
  • removed 'cache' code from source. Was always null.

0.0.4

  • move rollup and debounce to regular dependencies

0.0.3

  • added support for nodeJS 0.12
  • added cache

0.0.2

  • few fixes in the source
  • added linting
  • simpler bundling
  • still prefer to write the plugin in ES2015

0.0.1

Initial version