babel-minify-webpack-plugin icon indicating copy to clipboard operation
babel-minify-webpack-plugin copied to clipboard

Add TypeScript declarations to support Webpack configurations written in TypeScript as well

Open jsievenpiper opened this issue 6 years ago • 1 comments

This PR adds a simple start at hashing out the simpler parts of declaring TypeScript interfaces for consumers of babel-minify-webpack-plugin. This allows end-users to leverage this plugin in a TypeScript-authored Webpack config file:

import { Plugin } from 'webpack';
import Minify from 'babel-minify-webpack-plugin';

const plugins: Plugin[] = [ new Minify() ];

There were a couple cases where the plugin was being extremely robust to support just about any value passed in as a fallback (typically via boolean coercion) that isn't explicitly listed in the types (otherwise they'd fall down to TypeScript's any).

jsievenpiper avatar Mar 14 '19 00:03 jsievenpiper

CLA assistant check
All committers have signed the CLA.

jsf-clabot avatar Mar 14 '19 00:03 jsf-clabot