mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Added typings for gulp-terser (#35904)
Not much going on here since it imports all options from terser. Based it losely on the pre-existing gulp-uglify and webpack-terser-plugin typings as reference points Signed-off-by: Jeroen Claassens <support@favware.tech>
This commit is contained in:
committed by
Andrew Casey
parent
8cced78fff
commit
e253d335c1
@@ -0,0 +1,28 @@
|
||||
import * as gulp from 'gulp';
|
||||
import terser = require('gulp-terser');
|
||||
import pump = require('pump');
|
||||
|
||||
gulp.task('basic terser', () => {
|
||||
const tsResult = gulp.src('lib/*.ts')
|
||||
.pipe(terser())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('terser with options', () => {
|
||||
const tsResult = gulp.src('lib/*.ts')
|
||||
.pipe(terser({
|
||||
mangle: false,
|
||||
compress: false,
|
||||
}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('terser with pump', (cb) => {
|
||||
pump([
|
||||
gulp.src('lib/*.js'),
|
||||
terser(),
|
||||
gulp.dest('dist')
|
||||
],
|
||||
cb
|
||||
);
|
||||
});
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for gulp-terser 1.2
|
||||
// Project: https://github.com/duan602728596/gulp-terser#readme
|
||||
// Definitions by: Jeroen "Favna" Claassens <https://github.com/favna>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import { MinifyOptions } from 'terser';
|
||||
|
||||
export = terser;
|
||||
|
||||
declare function terser(options?: MinifyOptions): NodeJS.ReadWriteStream;
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"terser": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gulp-terser-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user