Vehmloewff/rollup-plugin-glob-files(新しいタブで開きます)
主要言語: TypeScript
Import files matching a glob pattern and export them as an array
- star 数
- 4
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 3
- 最終更新
- 2023/06/04
主要言語: TypeScript
Import files matching a glob pattern and export them as an array
Maintainers wanted! Contact me if interested (vehmloewff@gmail.com).
Import files matching a glob pattern and export them as an array.
This plugin works similar to webpack's require.context or require.ensure, but for rollup.
npm i rollup-plugin-glob-files -D
// rollup.plugin.js
import globFiles from 'rollup-plugin-glob-files';
export default {
// ...
plugins: [globFiles(options)],
};GlobOptions is an object which contains the following. All of the paramaters are optional except for file.
key: (required): This can be anything. Just remember to import by this key. If, for example, this was set to @awesome, you would:
import someArray from '@awesome';
include: This can be a single minimatch glob pattern, or an array of them. Default is ./**.
exclude: Same as include, except, of course, it excludes the files. Default is ./**/node_modules/**
importStar: Whether to use import * as something from 'other' in place of import something from 'other'. Default is false.
justImport: If the files should just be imported. Instead of import something from 'other', it just does this: import 'other'.