Skip to content

ember-cli/broccoli-terser-sourcemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6ef2518 · Oct 31, 2023
Oct 31, 2023
Oct 24, 2023
Oct 24, 2023
May 25, 2018
Jul 10, 2017
Oct 31, 2023
Dec 14, 2014
Sep 8, 2020
Sep 4, 2020
Sep 8, 2020
May 25, 2018
May 25, 2018
Oct 31, 2023
Oct 24, 2023

Repository files navigation

Build Status

A broccoli filter that applies terser to minify code while properly generating or maintaining sourcemaps.

installation

npm install --save broccoli-terser-sourcemap

usage

const Terser = require('broccoli-terser-sourcemap');

// basic usage
let minified = new Terser(input);

// advanced usage
let minified = new Terser(input, {
  exclude: [..], // array of globs, to not minify

  terser: {
    mangle: false,    // defaults to true
    compress: false,  // defaults to true
    sourceMap: false, // defaults to true
    //...
  },

  publicUrl: 'https://myamazingapp.com/', // value to be prepended to sourceMappingURL, defaults to ''
  hiddenSourceMap: false, // skips adding the reference to sourcemap in the minified JS, defaults to false

  concurrency: 3 // number of parallel workers, defaults to number of CPUs - 1
});

To disable parallelization:

$ JOBS=0
$ JOBS=1