Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gulp-plugin-terser

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-plugin-terser

Gulp plugin to minify files with terser

latest
Source
npmnpm
Version
4.0.1
Version published
Maintainers
0
Created
Source

gulp-plugin-terser Tests Version

Gulp plugin to minify files with terser

Getting Started

Installation

Installation can be done via package managers such as npm or yarn

$ npm install -D gulp-plugin-terser
# or
$ yarn add --dev gulp-plugin-terser

Usage

// gulpfile.js

const gulp = require('gulp');
const terser = require('gulp-plugin-terser');

function minify() {
  const options = {
    suffix: '.min.js',
    terserOptions: {
      output: {
        comments: true,
      },
    },
  };

  return gulp
    .src('dist/*.js', { sourcemaps: true })
    .pipe(sourcemap.init())
    .pipe(terser(options))
    .pipe(sourcemap.write('.'))
    .pipe(gulp.dest('dist/', { sourcemaps: '.' }));
}

gulp.series(minify);

The above gulp task will minify all the .js files in the dist directory and writes it into a new file with extension .min.js in the same directory.

Options

Keywords

gulp

FAQs

Package last updated on 22 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts