Skip to content

Commit

Permalink
terser on
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdesl committed Mar 10, 2019
1 parent acfae33 commit 3279d73
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tools/bundler.js
Expand Up @@ -9,7 +9,7 @@ const concat = require('concat-stream');
// Options for the build step
const config = {
// Whether to compress results with Terser
minify: false,
minify: true,
// 'bundle', 'dev' or 'serve'
mode: process.argv[2],
// Directory to serve/build into
Expand Down Expand Up @@ -135,7 +135,16 @@ function writeFile (file, code, cb) {
function compressIfNeeded (code) {
// Only compress in build mode
if (config.minify) {
const result = Terser.minify(code);
const result = Terser.minify(code, {
compress: {
keep_infinity: true,
pure_getters: true
},
warnings: true,
mangle: {
properties: false
}
});
const {
error,
warnings = []
Expand Down

0 comments on commit 3279d73

Please sign in to comment.