Skip to content

pioug/gulp-terser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-terser Run tests

Install

$ npm install github:pioug/gulp-terser#3.0.0

Example

const gulp = require("gulp");
const sourcemaps = require("gulp-sourcemaps");
const terser = require("gulp-terser");
const terserOptions = {
  compress: {
    drop_console: true,
    passes: 2,
  },
  output: {
    comments: false,
  },
};

gulp
  .src("script.js")
  .pipe(sourcemaps.init(terserOptions))
  .pipe(terser())
  .pipe(sourcemaps.write(""))
  .pipe(gulp.dest("build"));