broccoli-uglify-sourcemap
v4.0.0
Published
Broccoli filter to uglify files while preserving their sourcemaps.
Downloads
160,080
Keywords
Readme
A broccoli filter that applies terser to uglify code while properly generating or maintaining sourcemaps.
installation
npm install --save broccoli-uglify-sourcemap
usage
const Uglify = require('broccoli-uglify-sourcemap');
// basic usage
let uglified = new Uglify(input);
// advanced usage
let uglified = new Uglify(input, {
exclude: [..], // array of globs, to not minify
uglify: {
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