From 64b054d9a32bea5e81b4f47f0f6518f0dc3a6392 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 11 Mar 2024 17:21:47 +0300 Subject: [PATCH] [build] remove comments from source script --- build/Gruntfile.js | 3 +++ build/plugins/grunt-inline/tasks/inline.js | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 0f1f1dfcdf..45319ea836 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -452,6 +452,9 @@ module.exports = function(grunt) { }, inline: { + options: { + uglify: true + }, dist: { src: '<%= pkg.main.copy.indexhtml[0].dest %>/*.html' } diff --git a/build/plugins/grunt-inline/tasks/inline.js b/build/plugins/grunt-inline/tasks/inline.js index 3536237182..77a1f4da79 100644 --- a/build/plugins/grunt-inline/tasks/inline.js +++ b/build/plugins/grunt-inline/tasks/inline.js @@ -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);