{"id":21960,"library":"rollup-plugin-concat","title":"rollup-plugin-concat","description":"A Rollup plugin that concatenates files into single output files during the buildStart hook, making them available for import by other plugins. Version 1.0.4 is stable but has no recent updates (last release likely pre-2020). Key differentiator: integrates directly into Rollup's build pipeline with grouped file configurations. Alternative to manual concatenation or separate build steps.","status":"maintenance","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/mdownes/rollup-plugin-concat","tags":["javascript","rollup-plugin","rollup","concat"],"install":[{"cmd":"npm install rollup-plugin-concat","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-concat","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-concat","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail unless project uses esModuleInterop.","wrong":"const concat = require('rollup-plugin-concat')","symbol":"concat","correct":"import concat from 'rollup-plugin-concat'"},{"note":"The plugin exports a default function only.","wrong":"import { concat } from 'rollup-plugin-concat'","symbol":"default export","correct":"import concat from 'rollup-plugin-concat'"}],"quickstart":{"code":"import concat from 'rollup-plugin-concat';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    concat({\n      groupedFiles: [\n        {\n          files: ['./fileA.js', './fileB.js'],\n          outputFile: './ab.js'\n        }\n      ]\n    })\n  ]\n};","lang":"javascript","description":"Configures rollup-plugin-concat to concatenate fileA.js and fileB.js into ab.js before bundling."},"warnings":[{"fix":"Ensure that concatenated files are static or trigger a rebuild manually if they change.","message":"Plugin only runs on buildStart hook; output files are generated before subsequent plugins run, but are not watched for changes.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use absolute paths or resolve relative to __dirname.","message":"Output file paths are relative to the current working directory, not relative to the Rollup config file.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Consider using @rollup/plugin-multi-entry or manual concatenation scripts.","message":"The package has not been updated in several years; may not work with Rollup 3+ due to hook changes.","severity":"deprecated","affected_versions":">=2.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-plugin-concat --save-dev","cause":"Package not installed or import path incorrect.","error":"Error: Cannot find module 'rollup-plugin-concat'"},{"fix":"Use: import concat from 'rollup-plugin-concat'","cause":"Imported as named export instead of default.","error":"TypeError: concat is not a function"},{"fix":"Provide options as { groupedFiles: [ {...} ] }","cause":"Options object missing groupedFiles or not an array.","error":"[!] (plugin concat) Error: groupedFiles must be an array"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}