Skip to content

A Karma preprocessor plugin to offer seamless integration with Rollup.

Notifications You must be signed in to change notification settings

Vanilla-IceCream/karma-prerollup-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-prerollup-plugin Build Status Coverage Status

A Karma preprocessor plugin to offer seamless integration with Rollup.

Install

$ npm i karma-prerollup-plugin -D

Usage

// karma.conf.js
const postcss = require('rollup-plugin-postcss');
const cssnano = require('cssnano');
const buble = require('rollup-plugin-buble');
const globals = require('rollup-plugin-node-globals');
const builtins = require('rollup-plugin-node-builtins');
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');
const replace = require('rollup-plugin-replace');
const uglify = require('rollup-plugin-uglify');

module.exports = config => {
  config.set({
    // ...
    preprocessors: {
      'src/polyfills.js': ['prerollup'],
      'src/vendor.js': ['prerollup']
    },
    prerollupPreprocessor: {
      format: 'es',
      context: 'window',
      plugins: [
        postcss({ plugins: [cssnano()] }),
        buble(),
        globals(),
        builtins(),
        resolve({ jsnext: true, browser: true }),
        commonjs({ include: 'node_modules/**' }),
        replace({ eval: '[eval][0]' }),
        uglify()
      ]
    },
    // ...
  });
};

About

A Karma preprocessor plugin to offer seamless integration with Rollup.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published