@azimutlabs/rollup
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

🍣 azimutlabs logo /rollup

Collect Rollup configurations into a singular array

azimutlabs/rollup repository github workflow status azimutlabs/rollup repository license @azimutlabs/rollup

Installation

$ yarn add -D @azimutlabs/rollup

Usage

collect

Collect configurations by the given array of glob patterns.

/**
 * @param packages - packages glob patterns.
 * @param dirname - working directory root. defaults to the nearest package.json or process.cwd()
 */
function collect(packages: string[]): RollupConfigFinalize;

Given example:

// packages/ui/rollup.config.js
import compose from '@azimutlabs/rollup-config';
import babel from '@azimutlabs/rollup-config-babel';

export default babel();
// rollup.config.js
import { collect } from '@azimutlabs/rollup';

export default collect(['packages/*']);

...will result in:

// rollup.config.js
// packages/ui/lib/
//   index.es.js - output from babel
export default [
  { /* packages/ui/rollup.config.js */ }
];

fromWorkspaces

Get packages glob patterns from the workspaces field in the nearest package.json

function fromWorkspaces(): string[];

This is recommended usage when using yarn/npm workspaces feature.

// package.json
{
  "workspaces": [
    "packages/*"
  ]
}
// rollup.config.js
import { collect, fromWorkspaces } from '@azimutlabs/rollup';

export default collect(
  // Final collect scope will be: ['packages/*']
  fromWorkspaces()
);

Contributing

Any PR is welcomed by our @js-opensource team. Check out our contributing guidelines for more info.

License

azimutlabs rollup config license

Package Sidebar

Install

npm i @azimutlabs/rollup

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

25.6 kB

Total Files

16

Last publish

Collaborators

  • azimutlabs-owner
  • olehan