Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

feat: add typescript declaration file #38

Merged
merged 1 commit into from Jun 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions 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> | string | RegExp | null;
exclude?: Array<string | RegExp> | 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;
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -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": {
Expand Down