[build] remove comments from source script

This commit is contained in:
maxkadushkin
2024-03-11 17:21:47 +03:00
parent 9e3b3ad243
commit 64b054d9a3
2 changed files with 12 additions and 1 deletions

View File

@ -452,6 +452,9 @@ module.exports = function(grunt) {
},
inline: {
options: {
uglify: true
},
dist: {
src: '<%= pkg.main.copy.indexhtml[0].dest %>/*.html'
}

View File

@ -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);