@godxiaoji/rollup-plugin-require-context
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

rollup-plugin-require-context

Rollup plugin for resolving webpack require-context.

PS: 组件库需要用到这个插件,但是原来的作者已经不维护好久了,积累了一些bug,就把pull requests的合并一下上传。

Usage

import requireContext from 'rollup-plugin-require-context';

export default {
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'iife'
  },
  plugins: [
    requireContext()
  ]
};

Options

exclude

Type: string | string[]
Default: null

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore.

include

Type: string | string[]
Default: null

A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on.

extensions

Type: string[]
Default: ['.js']

Search for extensions other than .js in the order specified.

Package Sidebar

Install

npm i @godxiaoji/rollup-plugin-require-context

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

8.2 kB

Total Files

9

Last publish

Collaborators

  • godxiaoji