mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge pull request #15001 from dublicator/compression-webpack-plugin
Add compression-webpack-plugin
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import CompressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
const c: Configuration = {
|
||||
plugins: [
|
||||
new CompressionPlugin({
|
||||
asset: "[path].gz[query]",
|
||||
algorithm: "gzip",
|
||||
test: /\.js$|\.html$/,
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
]
|
||||
};
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// Type definitions for compression-webpack-plugin 0.3
|
||||
// Project: https://github.com/webpack-contrib/compression-webpack-plugin
|
||||
// Definitions by: Anton Kandybo <https://github.com/dublicator>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
export = CompressionPlugin;
|
||||
|
||||
declare class CompressionPlugin extends Plugin {
|
||||
constructor(options?: CompressionPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace CompressionPlugin {
|
||||
export interface Options {
|
||||
asset?: string;
|
||||
algorithm?: string;
|
||||
test?: RegExp | RegExp[];
|
||||
regExp?: RegExp | RegExp[];
|
||||
threshold?: number;
|
||||
minRatio?: number;
|
||||
|
||||
// zopfli options
|
||||
verbose?: boolean;
|
||||
verbose_more?: boolean;
|
||||
numiterations?: number;
|
||||
blocksplitting?: boolean;
|
||||
blocksplittinglast?: boolean;
|
||||
blocksplittingmax?: number;
|
||||
|
||||
// zlib options
|
||||
level?: number;
|
||||
flush?: number;
|
||||
chunkSize?: number;
|
||||
windowBits?: number;
|
||||
memLevel?: number;
|
||||
strategy?: number;
|
||||
dictionary?: any;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"compression-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../tslint.json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user