https://github.com/privatenumber/rollup-plugin-aggregate-exports
Emit an entry file to aggregate exports across multiple files.
https://github.com/privatenumber/rollup-plugin-aggregate-exports
aggregate exports plugin rollup
Last synced: 3 months ago
JSON representation
Emit an entry file to aggregate exports across multiple files.
- Host: GitHub
- URL: https://github.com/privatenumber/rollup-plugin-aggregate-exports
- Owner: privatenumber
- License: mit
- Created: 2020-12-26T18:44:54.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-12-27T20:51:03.000Z (almost 5 years ago)
- Last Synced: 2025-06-22T09:38:25.335Z (4 months ago)
- Topics: aggregate, exports, plugin, rollup
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rollup-plugin-aggregate-exports [](https://npm.im/rollup-plugin-aggregate-exports) [](https://npm.im/rollup-plugin-aggregate-exports) [](https://packagephobia.now.sh/result?p=rollup-plugin-aggregate-exports)
Emit an entry file to aggregate exports across multiple files.
If you like this project, please star it & [follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️
## 🚀 Install
```sh
npm i -D rollup-plugin-aggregate-exports
```## 🚦 Quick Setup
```js
import aggregateExports from 'rollup-plugin-aggregate-exports';const rollupConfig = {
input: 'src/file.js',
plugins: [
aggregateExports({
// file name for the entry file
fileName: 'index.js',// export statements
exports: [
{
identifier: 'default',
as: 'entry',
from: './entry.js',
},
{
identifier: 'default',
as: 'chunk',
from: './chunk.js',
},
],
}),
],
output: {
format: 'esm',
file: 'dist/entry.js',
exports: 'default',
},
};export default rollupConfig;
```## ⚙️ API
```ts
interface Export {
/**
* Path to import from
*/
from: string;/**
* Identifier to imort
*/
identifier: string;/**
* Name to export as
*/
as?: string;
}aggregateExports(options?: {
/**
* The file name to use for the emitted entry file.
*
* @defaultValue `index.js`
*/
fileName?: string;/**
* The exports you want to aggregate.
*
* @defaultValue `[]`
*/
exports?: (string | Export)[];
});
```