UNPKG

1.26 kBMarkdownView Raw
1# rollup-plugin-multi-entry
2
3Use multiple entry points in your [rollup](https://github.com/rollup/rollup)
4bundle. This is particularly useful for tests, but can also be used to package
5a library. The exports from all the entry points will be combined, e.g.
6
7```js
8// a.js
9export const a = 1;
10
11// b.js
12export const b = 2;
13
14// c.js
15export const c = 3;
16```
17
18Using all three files above as entry points will yield a bundle with exports for
19`a`, `b`, and `c`.
20
21## Install
22
23```
24$ npm install [--save-dev] rollup-plugin-multi-entry
25```
26
27## Usage
28
29In `rollup.config.js`:
30
31```js
32import multiEntry, { entry } from 'rollup-plugin-multi-entry';
33
34export default {
35 entry,
36 plugins: [multiEntry('test/**/*.js')]
37};
38```
39
40The `multiEntry` call above is the simplest form which simply takes a glob
41string. If you wish, you may pass an array of glob strings or, for finer
42control, an object with `include` and `exclude` properties each taking an array
43of glob strings, e.g.
44
45```js
46multiEntry('just/one/file.js');
47multiEntry('a/glob/of/files/**/*.js');
48multiEntry(['an/array.js', 'of/files.js', 'or/globs/**/*.js']);
49multiEntry({
50 include: ['files.js', 'and/globs/**/*.js', 'to/include.js'],
51 exclude: ['those/files.js', 'and/globs/*.to.be.excluded.js']
52});
53```
54
55## License
56
57MIT