{"id":21495,"library":"karma-rollup-plugin","title":"karma-rollup-plugin","description":"A Karma preprocessor plugin that integrates Rollup for on-the-fly bundling and ES2015+ transpilation in test environments. Current version is 0.2.4 (stable, but rarely updated). It supports Rollup plugins, source maps (inline), and multiple ES versions via Babel or Buble. Compared to alternatives like karma-rollup-preprocessor, this plugin is simpler, more actively maintained at the time, and more aligned with the Rollup ecosystem. However, it lacks modern Rollup features and may not work with Rollup >=1.0.","status":"maintenance","version":"0.2.4","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/TrySound/karma-rollup-plugin","tags":["javascript","karma","karma-plugin","karma-preprocessor","modules","es2016","rollup","preprocessor"],"install":[{"cmd":"npm install karma-rollup-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add karma-rollup-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add karma-rollup-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for bundling functionality","package":"rollup","optional":false}],"imports":[{"note":"The plugin is automatically loaded by Karma. No explicit require() in karma.conf.js.","wrong":"rollupPreprocessor: require('karma-rollup-plugin')","symbol":"rollupPreprocessor (Karma config key)","correct":"// In karma.conf.js\nrollupPreprocessor: { /* options */ }"},{"note":"Plugin exports a function for programmatic configuration, but typically used via Karma config.","wrong":"import karmaRollup from 'karma-rollup-plugin';","symbol":"Plugin as a module (programmatic use)","correct":"const karmaRollup = require('karma-rollup-plugin');"},{"note":"Use the short name 'rollup', not the package name.","wrong":"preprocessors: { 'test/**/*.js': ['karma-rollup-plugin'] }","symbol":"Preprocessor in preprocessors","correct":"preprocessors: { 'test/**/*.js': ['rollup'] }"}],"quickstart":{"code":"// karma.conf.js\nmodule.exports = function (config) {\n  config.set({\n    basePath: '',\n    frameworks: ['jasmine'],\n    files: [\n      'test/**/*.spec.js'\n    ],\n    preprocessors: {\n      'test/**/*.spec.js': ['rollup']\n    },\n    rollupPreprocessor: {\n      plugins: [ require('rollup-plugin-buble')() ],\n      format: 'iife',\n      sourceMap: 'inline'\n    },\n    reporters: ['progress'],\n    port: 9876,\n    colors: true,\n    logLevel: config.LOG_INFO,\n    autoWatch: true,\n    browsers: ['ChromeHeadless'],\n    singleRun: false\n  });\n};","lang":"javascript","description":"Configures Karma to use the rollup preprocessor for test files, with Rollup and Buble plugin for transpilation."},"warnings":[{"fix":"Upgrade to a maintained fork or use karma-rollup-preprocessor with Rollup compatibility.","message":"No support for Rollup >=1.0 due to API changes.","severity":"breaking","affected_versions":">=0.2.4"},{"fix":"Consider using @open-wc/karma-esm or karma-rollup-preprocessor.","message":"Package is no longer actively maintained; last release was years ago.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Always specify a module name when using 'umd', or use 'iife' for tests.","message":"Using 'umd' format without a module name throws a warning and may produce unexpected results.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set sourceMap: 'inline' in rollupPreprocessor config.","message":"Source maps must be 'inline' because Karma expects them inlined for proper debugging.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: npm install rollup --save-dev","cause":"Rollo is not installed or is a missing peer dependency.","error":"Error: Cannot find module 'rollup'"},{"fix":"Install Rollup 0.x: npm install rollup@0.68.2 --save-dev","cause":"Incompatible Rollup version >=1.0 where API changed.","error":"TypeError: rollup.rollup is not a function"},{"fix":"Add moduleName to rollupPreprocessor or switch to 'iife'.","cause":"Using 'umd' format without 'moduleName' in rollupPreprocessor.","error":"WARN: 'umd' format requires a module name. Use the 'moduleName' option."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}