Allows specifying multiple entry points with rollup.
Last updated 3 years ago by lhorie .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lhorie/rollup-plugin-multi-entry 
SYNC missed versions from official npm registry.


Use multiple entry points in your rollup bundle. This is particularly useful for tests, but can also be used to package a library. The exports from all the entry points will be combined, e.g.

// a.js
export const a = 1;

// b.js
export const b = 2;

// c.js
export const c = 3;

Using all three files above as entry points will yield a bundle with exports for a, b, and c.


$ npm install [--save-dev] rollup-plugin-multi-entry


This plugin requires at least v0.25.4 of rollup. In rollup.config.js:

import multiEntry from 'rollup-plugin-multi-entry';

export default {
  input: 'test/**/*.js',
  plugins: [multiEntry()]

The entry above is the simplest form which simply takes a glob string. If you wish, you may pass an array of glob strings or, for finer control, an object with include and exclude properties each taking an array of glob strings, e.g.

// The usual rollup entry configuration works.
export default {
  input: 'just/one/file.js',
  plugins: [multiEntry()]
  // ...

// As does a glob of files.
export default {
  input: 'a/glob/of/files/**/*.js',
  plugins: [multiEntry()]
  // ...

// Or an array of files and globs.
export default {
  input: ['an/array.js', 'of/files.js', 'or/globs/**/*.js'],
  plugins: [multiEntry()]
  // ...

// For maximum control, arrays of globs to include and exclude.
export default {
  input: {
    include: ['files.js', 'and/globs/**/*.js', 'to/include.js'],
    exclude: ['those/files.js', 'and/globs/*.to.be.excluded.js']
  plugins: [multiEntry()]
  // ...

Sometimes you may not want to export anything from the rolled-up bundle. In such cases, use the exports: false option like so:

export default {
  input: 'src/*.js',
  plugins: [multiEntry({ exports: false })]



Current Tags

  • 2.0.1                                ...           latest (3 years ago)

1 Versions

  • 2.0.1                                ...           3 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |