An open API service indexing awesome lists of open source software.

https://github.com/ember-cli/broccoli-terser-sourcemap

Broccoli filter to uglify with sourcemaps
https://github.com/ember-cli/broccoli-terser-sourcemap

broccoli uglify

Last synced: 7 months ago
JSON representation

Broccoli filter to uglify with sourcemaps

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/ember-cli/broccoli-terser-sourcemap.svg?branch=master)](https://travis-ci.org/ember-cli/broccoli-terser-sourcemap)

A broccoli filter that applies [terser](https://github.com/terser/terser) to
minify code while properly generating or maintaining sourcemaps.

### installation

```sh
npm install --save broccoli-terser-sourcemap
```

### usage

```js
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
```