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
- Host: GitHub
- URL: https://github.com/ember-cli/broccoli-terser-sourcemap
- Owner: ember-cli
- License: mit
- Created: 2014-12-14T06:13:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T11:43:17.000Z (about 2 years ago)
- Last Synced: 2025-06-05T00:20:02.763Z (8 months ago)
- Topics: broccoli, uglify
- Language: JavaScript
- Homepage:
- Size: 1.45 MB
- Stars: 10
- Watchers: 9
- Forks: 35
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](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
```