Skip to content

Commit

Permalink
[build] remove comments from source script
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Mar 11, 2024
1 parent 9e3b3ad commit 64b054d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ module.exports = function(grunt) {
},

inline: {
options: {
uglify: true
},
dist: {
src: '<%= pkg.main.copy.indexhtml[0].dest %>/*.html'
}
Expand Down
10 changes: 9 additions & 1 deletion build/plugins/grunt-inline/tasks/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ module.exports = function(grunt) {
let c = rawstr;

if ( options.uglify ) {
const uglstr = UglifyJS.minify(rawstr);
const opts = {
output: {
comments: false,
beautify: false,
},
mangle: false,
compress: false,
};
const uglstr = UglifyJS.minify(rawstr, opts);
if ( uglstr.error == undefined )
c = uglstr.code;
else grunt.log.error("uglify error " + uglstr.code);
Expand Down

0 comments on commit 64b054d

Please sign in to comment.