Skip to content

Commit

Permalink
Minify detect.js output
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinlondon authored and JakeChampion committed Feb 22, 2019
1 parent 891d916 commit cf1d139
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions tasks/node/buildsources.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class Polyfill {

if (fs.existsSync(this.detectPath)) {
this.config.detectSource = fs.readFileSync(this.detectPath, 'utf8').replace(/\s*$/, '') || '';
this.config.detectSource = this.minify(this.config.detectSource).min;
validateSource(`if (${this.config.detectSource}) true;`, `${this.name} feature detect from ${this.detectPath}`);
}
});
Expand Down Expand Up @@ -215,9 +216,9 @@ class Polyfill {

const minified = uglify.minify(source, {
fromString: true,
compress: { screw_ie8: false },
compress: { screw_ie8: false, expression: true },
mangle: { screw_ie8: false },
output: { screw_ie8: false, beautify: false }
output: { screw_ie8: false, beautify: false, semicolons: false }
});

return { raw, min: minified.code };
Expand Down

0 comments on commit cf1d139

Please sign in to comment.