karma-prerollup-plugin
A Karma preprocessor plugin to offer seamless integration with Rollup.
Install
$ npm i karma-prerollup-plugin -D
Usage
module.exports = config => {
config.set({
preprocessors: {
'src/polyfills.js': ['prerollup'],
'src/vendor.js': ['prerollup'],
'src/**/*.spec.js': ['rollup']
},
prerollupPreprocessor: {
plugins: [
postcss({ plugins: [cssnano()] }),
babel({
babelrc: false,
presets: [['latest', { es2015: { modules: false } }]],
plugins: ['external-helpers'],
exclude: 'node_modules/**'
}),
globals(),
builtins(),
resolve({ jsnext: true, browser: true }),
commonjs({ include: 'node_modules/**' }),
replace({ eval: '[eval][0]' }),
uglify()
],
format: 'iife'
},
rollupPreprocessor: {
plugins: [
],
format: 'iife',
sourceMap: 'inline'
},
});
};