1. rollup-plugin-multi-entry
Allows specifying multiple entry points with rollup.
rollup-plugin-multi-entry
Package: rollup-plugin-multi-entry
Created by: rollup
Last modified: Sun, 26 Jun 2022 14:00:20 GMT
Version: 2.1.0
License: MIT
Downloads: 17,623
Repository: https://github.com/rollup/rollup-plugin-multi-entry

Install

npm install rollup-plugin-multi-entry
yarn add rollup-plugin-multi-entry

rollup-plugin-multi-entry

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.

Install

 # 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

Usage

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 })]
};

License

MIT

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin