UNPKG

1.54 kBTypeScriptView Raw
1import { Plugin } from 'rollup';
2
3interface RollupCommonJSOptions {
4 /**
5 * non-CommonJS modules will be ignored, but you can also
6 * specifically include/exclude files
7 * @default undefined
8 */
9 include?: string | RegExp | ReadonlyArray<string | RegExp>,
10 /**
11 * non-CommonJS modules will be ignored, but you can also
12 * specifically include/exclude files
13 * @default undefined
14 */
15 exclude?: string | RegExp | ReadonlyArray<string | RegExp>,
16 /**
17 * search for files other than .js files (must already
18 * be transpiled by a previous plugin!)
19 * @default [ '.js' ]
20 */
21 extensions?: ReadonlyArray<string | RegExp>,
22 /**
23 * if true then uses of `global` won't be dealt with by this plugin
24 * @default false
25 */
26 ignoreGlobal?: boolean,
27 /**
28 * if false then skip sourceMap generation for CommonJS modules
29 * @default true
30 */
31 sourceMap?: boolean,
32 /**
33 * explicitly specify unresolvable named exports
34 * ([see below for more details](https://github.com/rollup/rollup-plugin-commonjs#custom-named-exports))
35 * @default undefined
36 */
37 namedExports?: { [package: string]: ReadonlyArray<string> },
38 /**
39 * sometimes you have to leave require statements
40 * unconverted. Pass an array containing the IDs
41 * or a `id => boolean` function. Only use this
42 * option if you know what you're doing!
43 */
44 ignore?: ReadonlyArray<string | ((id: string) => boolean)>,
45}
46
47/**
48 * Convert CommonJS modules to ES6, so they can be included in a Rollup bundle
49 */
50export default function commonjs(options?: RollupCommonJSOptions): Plugin;
51
\No newline at end of file