Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rollup-plugin-glob-import

kei-ito7.2kMIT0.5.0TypeScript support: included

A rollup plugin to use glob-star.

rollup, glob

readme

rollup-plugin-glob-import

CircleCI Build Status Build status codecov

A plugin to use glob-star.

Installation

npm install --save-dev rollup-plugin-glob-import

Usage

// rollup.config.js
const globImport = require('rollup-plugin-glob-import');
// import {plugin as globImport} from 'rollup-plugin-glob-import';
export default {
  input: 'path/to/input.js',
  plugins: [
    globImport(options) // See the "Options" section below.
  ]
}

Example

Options

export interface IGlobPluginOptions {
    /**
     * The first argument of [rollup-pluginutils.createfilter](https://github.com/rollup/rollup-pluginutils#createfilter).
     */
    include?: Parameters<CreateFilter>[0],
    /**
     * The second argument of [rollup-pluginutils.createfilter](https://github.com/rollup/rollup-pluginutils#createfilter).
     */
    exclude?: Parameters<CreateFilter>[0],
    /**
     * - `'import'`: The intermediate files work as importer that export nothing.
     * - `'named'`: The intermediate files export only **named** exports.
     * - `'default'`: The intermediate files export only **default** exports.
     * - `'mixed'`: This plugin read the imported files and parse it with
     *   [acorn](https://www.npmjs.com/package/acorn) to check default exports.
     *   Intermediate files export both named exports and default exports.
     */
    format?: IntermediateFileFormat,
    /**
     * A function generates the name of exports.
     * It is used if `options.format` is `'mixed'` or `'default'`.
     * For example, if an imported module `/src/foo.js` has
     * `export const bar = 123` and `export default 456`, it is called twice:
     * `rename('bar', '/src/foo.js')`, `rename(null, '/src/foo.js')`.
     * If a return values is falsy value, it is ignored.
     */
    rename?: (name: string, id: string) => string,
    /**
     * [acorn](https://www.npmjs.com/package/acorn) options.
     * The default value is `{sourceType: 'module'}`.
     */
    acorn?: acorn.Options,
    /**
     * A function called before generating intermediate files.
     * You can add or remove files from sources.
     */
    intercept?: (sources: Array<string>, importer: string, importee: string) => Array<string>,
}

https://github.com/kei-ito/rollup-plugin-glob-import/blob/d5d6d22d322da92ca8026322b2d629689fd8496d/lib/index.d.ts#L12-L49

License

MIT

changelog

Changelog

v0.5.0 (2021-05-02)

Tests

  • run tests (6dec4ed)
  • remove nlib/afs (61822a1)

Code Refactoring

  • fix eslint errors (6a89338)

Styles

  • fix eslint errors (567bfd8)
  • change an interface (a4ea172)

Documentation

  • build samples (2db8830)
  • update sample (d5479ce)

Continuous Integration

  • skip build (dbdf701)
  • remove other ci configs (8192202)
  • setup github actions (d901303)

Dependency Upgrades

  • @typescript-eslint/eslint-plugin:2.7.0→4.22.0 @typescript-eslint/parser:4.2.0→4.22.0 eslint:7.7.0→7.25.0 lint-staged:10.0.7→10.5.4 rollup:2.0.2→2.46.0 tap:14.9.2→15.0.6 typescript:4.0.2→4.2.4 (e81eb08)

v0.4.5 (2019-11-13)

Bug Fixes

  • filter importer (f74aedb)

Tests

  • filters (dccdad7)

Code Refactoring

  • replace keywords (e14ce8c)
  • export IntermediateFileFormat (ef68e89)

Styles

  • a bit change (7973867)

Documentation

  • update readme (9f59666)

v0.4.4 (2019-10-18)

Features

  • expose camelCase (6615a68)

Tests

  • camelCase (86c83ff)

v0.4.3 (2019-10-18)

Features

  • add index.d.ts (d5d6d22)

Documentation

  • quote declarations (ec94951)
  • add a link to declaration (cb81ea8)

v0.4.2 (2019-10-18)

Features

  • export the plugin as 'plugin' (881eebd)

v0.4.1 (2019-10-18)

v0.4.0 (2019-10-18)

Features

  • export defaultRenamer (2f554a3)

Tests

  • defaultRenamer (49850a5)

Documentation

  • update the badges (ee2c755)

v0.3.1 (2018-12-30)

Bug Fixes

  • install npm-run-all (d792add)

v0.3.0 (2018-09-20)

v0.2.4 (2018-08-09)

v0.2.3 (2018-06-07)

v0.2.2 (2018-04-24)

v0.2.1 (2018-04-24)

v0.2.0 (2018-04-23)

v0.1.4 (2018-01-10)

v0.1.3 (2018-01-09)

v0.1.2 (2018-01-06)

v0.1.1 (2017-12-26)

v0.1.0 (2017-12-26)

v0.0.9 (2017-10-18)

v0.0.8 (2017-09-15)

v0.0.7 (2017-09-12)

v0.0.6 (2017-09-11)

v0.0.5 (2017-09-11)

v0.0.4 (2017-07-17)

v0.0.3 (2017-07-03)

v0.0.2 (2017-04-08)