1 | // Type definitions for optimize-css-assets-webpack-plugin 5.0
|
2 | // Project: https://github.com/nmfr/optimize-css-assets-webpack-plugin
|
3 | // Definitions by: Armando Meziat <https://github.com/odnamrataizem>
|
4 | // Spencer Miskoviak <https://github.com/skovy>
|
5 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
6 | // TypeScript Version: 3.7
|
7 |
|
8 | import { WebpackPluginInstance as Plugin, Compiler } from 'webpack';
|
9 |
|
10 | export = OptimizeCssAssetsPlugin;
|
11 |
|
12 | declare namespace OptimizeCssAssetsPlugin {
|
13 | interface Options {
|
14 | /**
|
15 | * A regular expression that indicates the names of the assets that should
|
16 | * be optimized \ minimized. The regular expression provided is run against
|
17 | * the filenames of the files exported by the `ExtractTextPlugin` instances
|
18 | * in your configuration, not the filenames of your source CSS files
|
19 | *
|
20 | * @default /\.css$/g
|
21 | */
|
22 | assetNameRegExp?: RegExp | undefined;
|
23 | /**
|
24 | * The CSS processor used to optimize \ minimize the CSS. This should be a
|
25 | * function that follows `cssnano.process` interface (receives a CSS and
|
26 | * options parameters and returns a Promise).
|
27 | *
|
28 | * @default cssnano
|
29 | */
|
30 | cssProcessor?: {
|
31 | process: (css: string, options?: object) => PromiseLike<any>;
|
32 | } | undefined;
|
33 | /**
|
34 | * The options passed to the `cssProcessor`.
|
35 | *
|
36 | * @default {}
|
37 | */
|
38 | cssProcessorOptions?: object | undefined;
|
39 | /**
|
40 | * The plugin options passed to the `cssProcessor`.
|
41 | *
|
42 | * @default {}
|
43 | */
|
44 | cssProcessorPluginOptions?: object | undefined;
|
45 | /**
|
46 | * A boolean indicating if the plugin can print messages to the console.
|
47 | *
|
48 | * @default true
|
49 | */
|
50 | canPrint?: boolean | undefined;
|
51 | }
|
52 | }
|
53 |
|
54 | declare class OptimizeCssAssetsPlugin implements Plugin {
|
55 | constructor(options?: OptimizeCssAssetsPlugin.Options);
|
56 | apply(compiler: Compiler): void;
|
57 | }
|