karma-rollup-plugin

A Karma preprocessor plugin to offer seamless integration with Rollup

MIT 52 个版本
安装
npm install karma-rollup-plugin
yarn add karma-rollup-plugin
pnpm add karma-rollup-plugin
bun add karma-rollup-plugin
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.

版本列表
0.2.4 2016-09-23
0.2.3 2016-09-08
0.2.2 2016-08-13
0.2.1 2016-07-31
0.2.0 2016-07-13
0.1.11 2016-07-11
0.1.10 2016-07-11
0.1.9-b 2016-07-11
0.1.9-a 2016-07-11
0.1.9 2016-07-11
0.1.8-a 2016-07-11
0.1.8 2016-07-11
0.1.7 2016-07-11
0.1.6-b 2016-07-11
0.1.6-a 2016-07-11
0.1.6 2016-07-11
0.1.6-i 2016-07-11
0.1.6-h 2016-07-11
0.1.6-g 2016-07-11
0.1.6-f 2016-07-11
0.1.6-e 2016-07-11
0.1.6-d 2016-07-11
0.1.6-c 2016-07-11
0.1.5 2016-07-11
0.1.4-b 2016-07-10
0.1.4-a 2016-07-10
0.1.4 2016-07-10
0.1.4-h 2016-07-11
0.1.4-g 2016-07-11
0.1.4-f 2016-07-11
0.1.4-e 2016-07-11
0.1.4-d 2016-07-10
0.1.4-c 2016-07-10
0.1.3 2016-07-10
0.1.2 2016-07-10
0.1.1 2016-07-10
0.1.0-a 2016-07-10
0.1.0 2016-07-10
0.0.14 2016-07-10
0.0.13 2016-07-10
0.0.12 2016-07-10
0.0.11 2016-07-10
0.0.10 2016-07-10
0.0.9 2016-07-10
0.0.8 2016-07-09
0.0.7 2016-07-09
0.0.6 2016-07-09
0.0.5 2016-07-09
0.0.4 2016-07-09
0.0.3 2016-07-09
0.0.2 2016-07-09
0.0.1 2016-07-09