webpack-contrib / babel-minify-webpack-plugin

[DEPRECATED] Babel Minify Webpack Plugin
MIT License
491 stars 44 forks source link

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

Open jsievenpiper opened 5 years ago

jsievenpiper commented 5 years ago

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).

jsf-clabot commented 5 years ago

CLA assistant check
All committers have signed the CLA.