Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
rollup-plugin-multi-entry
Advanced tools
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
.
Note: Default exports like
export default class Foo {...}
will not be exported, only named exports are allowed.
# We use yarn:
$ yarn add [--dev] rollup-plugin-multi-entry
# But you can use npm if you prefer:
$ npm install [--save-dev] rollup-plugin-multi-entry
This plugin requires at least v0.48.0 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 })]
};
MIT
FAQs
Allows specifying multiple entry points with rollup.
The npm package rollup-plugin-multi-entry receives a total of 1,639 weekly downloads. As such, rollup-plugin-multi-entry popularity was classified as popular.
We found that rollup-plugin-multi-entry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.