JSPM

  • Created
  • Published
  • Downloads 90665
  • Score
    100M100P100Q162813F
  • License MIT

Karma preprocessor to bundle ES6 modules using Rollup

Package Exports

  • karma-rollup-preprocessor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (karma-rollup-preprocessor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Karma preprocessor to bundle ES6 modules using Rollup.

Build Status Dependency Status Downloads Version License


Features

  • Rebundles your files when watched dependencies change
  • Caches bundle output for improved performance
  • Maintained with heart by @jlmakes

Installation

npm install karma-rollup-preprocessor --save-dev

Configuration

All the options detailed in the Rollup Documentation can be passed to rollupPreprocessor.

Example

Below is a well-founded recommendation using the Bublé ES2015 transpiler:

// karma.conf.js
module.exports = function (config) {
    config.set({

        files: [
            'src/**/*.js',
            'test/**/*.spec.js',
        ],

        preprocessors: {
            'src/**/*.js': ['rollup'],
            'test/**/*.spec.js': ['rollup'],
        },

        rollupPreprocessor: {
            plugins: [
                require('rollup-plugin-buble')(),
            ],
            format: 'iife',              // helps prevent naming collisions
            moduleName: '<your_project>' // required for 'iife' format
            sourceMap: 'inline',         // sensible for testing
        },
    });
};

Support

Supports all Rollup plug-ins, and works on Node 0.12.x and up. Happy bundling!