rollup-plugin-combine

raw JSON →
2.1.1 verified Mon Apr 27 auth: no javascript

A Rollup plugin that merges multiple JavaScript files into a single output, supporting both library and application builds. The current stable version is 2.1.1, released with a moderate cadence. It differentiates from similar plugins by offering fine-grained control over file ordering and custom transforms during concatenation. However, it lacks TypeScript support and is primarily used in legacy workflows where bundle splitting is not required.

error TypeError: combine is not a function
cause Using named import instead of default import.
fix
Use 'import combine from 'rollup-plugin-combine'' instead of 'import { combine } from ...'
error Error: The 'output' option must be specified.
cause Missing required 'output' option in plugin configuration.
fix
Add 'output' property to the plugin options, e.g., output: 'bundle.js'
error Module not found: Can't resolve 'rollup-plugin-combine'
cause Package not installed or missing from dependencies.
fix
Run 'npm install rollup-plugin-combine' and ensure it's in your package.json.
gotcha Plugin does not support source maps; combining files may break debugging experience.
fix Use alternative plugin with source map support or disable source maps in Rollup.
deprecated Option 'files' is deprecated, use 'include' instead.
fix Rename 'files' to 'include' in plugin options.
breaking In v2, output option is required; previous versions allowed omission.
fix Ensure 'output' is provided in plugin options.
npm install rollup-plugin-combine
yarn add rollup-plugin-combine
pnpm add rollup-plugin-combine

Combines two input files into a single output file using the plugin.

// rollup.config.js
import combine from 'rollup-plugin-combine';

export default {
  input: 'src/index.js',
  output: {
    dir: 'dist',
    format: 'esm'
  },
  plugins: [
    combine({
      files: ['src/utils.js', 'src/main.js'],
      output: 'dist/bundle.js'
    })
  ]
};