Registry / devops / rollup-plugin-multi-dest

rollup-plugin-multi-dest

JSON →
library1.0.2jsnpmunverified

Rollup plugin that allows a single Rollup configuration to output to multiple destinations with different formats and plugins. Current version 1.0.2, released in 2018, with no recent updates. It eliminates the need for multiple config files by accepting an array of output configurations, each with its own dest, format, and optional plugins. Useful for libraries that need to distribute ESM, CJS, and IIFE bundles. Note: this plugin uses Rollup's legacy `entry`/`dest` config style and may require adaptation for modern Rollup versions. It has 0 dependencies and is unmaintained since 2020.

npm install rollup-plugin-multi-dest
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MULT
R
rollup-plugin-multi-dest
devopsjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import multidest from 'rollup-plugin-multi-dest'
const multidest = require('rollup-plugin-multi-dest')
Package is ESM-only; no CommonJS export provided.
multidest
import multidest from 'rollup-plugin-multi-dest'
import { multidest } from 'rollup-plugin-multi-dest'
Default export only, not a named export.
multidest
const multidest = require('rollup-plugin-multi-dest').default
const multidest = require('rollup-plugin-multi-dest')
In CommonJS, you must access the .default property due to ESM interop.

Configures Rollup to output an ES module as primary dest, plus additional CJS and IIFE bundles using the multidest plugin.

// rollup.config.js import multidest from 'rollup-plugin-multi-dest'; import resolve from 'rollup-plugin-node-resolve'; export default { entry: 'src/index.js', dest: 'dist/bundle.esm.js', format: 'es', plugins: [ resolve(), multidest([ { dest: 'dist/bundle.cjs.js', format: 'cjs' }, { dest: 'dist/bundle.iife.js', format: 'iife', moduleName: 'MyLib' } ]) ] };
Debug
Known issues
breakingPlugin targets legacy Rollup API (entry/dest). In Rollup >=1.0, use input/output config style. Plugin may not work with Rollup >=2.0.
fix
Migrate to Rollup's built-in output array feature: export default { input: 'src/index.js', output: [{ file: 'dist/bundle.esm.js', format: 'es' }, { file: 'dist/bundle.cjs.js', format: 'cjs' }], plugins: [...] }
affects: >=1.0.2
deprecatedThe plugin is unmaintained since 2020; no updates for Rollup 2/3 compatibility.
fix
Use Rollup's native multiple output feature instead of this plugin.
affects: >=1.0.2
gotchaPlugin only applies to the first-level dest; it duplicates the output with its own plugins but does not share the parent's plugins automatically.
fix
Ensure all necessary plugins are included in the multidest array for each output, or rely on the parent plugins only.
affects: >=0.0.0
gotchaThe plugin does not support sourcemaps; sourcemaps will not be generated for additional destinations.
fix
Use Rollup's newer output array which supports sourcemap per output.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot read property 'map' of undefined
The plugin expects the Rollup bundle object to contain a modules array; incompatible with Rollup >=0.60.
fix
Use a Rollup version <0.60 or switch to native multiple output.
Error: Could not resolve entry (src/index.js)
Using modern Rollup input/output config but plugin still expects legacy entry/dest.
fix
Either revert to legacy Rollup config or use Rollup's output array instead of the plugin.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-multi-dest — npm install rollup-plugin-multi-dest · libregistry