Merge pull request #2881 from ONLYOFFICE/feature/ref-index-html

[build] remove comments from source script
This commit is contained in:
Maxim Kadushkin
2024-04-04 16:00:26 +03:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@ -458,6 +458,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);