diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..ca44717 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,26 @@ +import { Plugin } from 'rollup'; +import { MinifyOptions } from 'terser'; + +export interface Options extends MinifyOptions { + + /** + * Specifically include/exclude chunk files names (minimatch pattern, or array of minimatch patterns), By default all chunk files will be minify. + */ + include?: Array | string | RegExp | null; + exclude?: Array | string | RegExp | null; + + /** + * Amount of workers to spawn. Defaults to the number of CPUs minus 1. + */ + numWorkers?: number; + + /** + * Generates source maps and passes them to rollup. + * + * @default true + */ + sourcemap?: boolean; + +} + +export declare function terser(options?: Options): Plugin; diff --git a/package.json b/package.json index c0cc5c3..512ff24 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,10 @@ "version": "5.0.0", "description": "Rollup plugin to minify generated es bundle", "main": "index.js", + "types": "index.d.ts", "files": [ "index.js", + "index.d.ts", "transform.js" ], "scripts": {