{"id":21496,"library":"karma-rollup-preprocessor","title":"karma-rollup-preprocessor","description":"Karma preprocessor to bundle ES modules using Rollup. Current stable version 7.0.8 (last released 2021). Release cadence is sporadic with long gaps between major versions. Key differentiators: integrates Rollup into Karma test pipeline, supports all Rollup options, allows multiple configured preprocessors for different transpilation setups. Requires Rollup >=1.0.0 as peer dependency.","status":"maintenance","version":"7.0.8","language":"javascript","source_language":"en","source_url":"git://github.com/jlmakes/karma-rollup-preprocessor","tags":["javascript","es","es2015","karma","modules","import","export","plugin","preprocessor"],"install":[{"cmd":"npm install karma-rollup-preprocessor","lang":"bash","label":"npm"},{"cmd":"yarn add karma-rollup-preprocessor","lang":"bash","label":"yarn"},{"cmd":"pnpm add karma-rollup-preprocessor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; used for bundling ES modules","package":"rollup","optional":false}],"imports":[{"note":"Configuration is set inside Karma config function, not exported directly.","wrong":"module.exports = { rollupPreprocessor: ... }","symbol":"rollupPreprocessor","correct":"config.set({ rollupPreprocessor: { ... } })"},{"note":"The preprocessor name is 'rollup', not 'rollupPreprocessor'. The configuration key is 'rollupPreprocessor'.","wrong":"preprocessors: { 'test/**/*.spec.js': ['rollupPreprocessor'] }","symbol":"rollup","correct":"preprocessors: { 'test/**/*.spec.js': ['rollup'] }"},{"note":"The base preprocessor is referenced as 'rollup', not 'rollupPreprocessor'.","wrong":"customPreprocessors: { rollupBabel: { base: 'rollupPreprocessor', options: { ... } } }","symbol":"customPreprocessors","correct":"customPreprocessors: { rollupBabel: { base: 'rollup', options: { ... } } }"}],"quickstart":{"code":"// karma.conf.js\nmodule.exports = function(config) {\n  config.set({\n    files: [\n      { pattern: 'test/**/*.spec.js', watched: false }\n    ],\n    preprocessors: {\n      'test/**/*.spec.js': ['rollup']\n    },\n    rollupPreprocessor: {\n      plugins: [\n        require('rollup-plugin-commonjs')(),\n        require('rollup-plugin-node-resolve')()\n      ],\n      output: {\n        format: 'iife',\n        name: 'MyTest',\n        sourcemap: 'inline'\n      }\n    }\n  });\n};","lang":"javascript","description":"Basic Karma configuration with rollupPreprocessor for bundling test files."},"warnings":[{"fix":"Replace require('rollup-plugin-buble') with require('@rollup/plugin-buble') and update configuration accordingly.","message":"rollup-plugin-buble and rollup-plugin-babel are no longer maintained; use @rollup/plugin-buble and @rollup/plugin-babel instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Set `watched: false` in the files array for patterns handled by rollup preprocessor.","message":"Karma's file watcher must be disabled for files processed by rollupPreprocessor (watched: false).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not specify `input` in rollupPreprocessor options; the preprocessor sets it to each test file.","message":"The Rollup input option is handled automatically; setting it manually can cause issues.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use relative paths or update to version 7.0.8 which includes a fix.","message":"Source map file paths may be incorrect on Windows when using absolute paths.","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"In preprocessors config, use 'rollup' as the preprocessor name, not 'rollupPreprocessor'.","cause":"Preprocessor name used incorrectly (e.g., 'rollupPreprocessor' instead of 'rollup').","error":"Error: Invalid configuration: preprocessors.rollup expected a string or an array of strings."},{"fix":"Ensure rollupPreprocessor is defined inside config.set({...}) as a top-level key.","cause":"rollupPreprocessor object is missing or not correctly placed in Karma config.","error":"TypeError: Cannot read property 'plugins' of undefined"},{"fix":"Install missing npm packages and configure resolve plugins (e.g., @rollup/plugin-node-resolve).","cause":"Input file not found because Rollup is trying to resolve a missing module.","error":"Error: ENOENT: no such file or directory, open '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}