summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2021-01-05 15:14:17 +0100
committerDavid Ostrovsky <david@ostrovsky.org>2021-01-05 20:40:36 +0100
commit9b0b7b9b1c478b52b919c631d47e668856d1fdd8 (patch)
tree9c77388160bcea30412bf37f0c4fb5ffec145f4d
parent358fe468439fa36c0944ee758e9aff8f042f2fab (diff)
Polygerrit: Wipe out license headers in minified gr-app.js
By default terser keeps all licensing comments as many licenses require you to keep a copy of the license in redistributed source: [1] --comments [filter] Preserve copyright comments in the output. By default this works like Google Closure, keeping JSDoc-style comments that contain "@license" or "@preserve". You can optionally pass one of the following arguments to this flag: - "all" to keep all comments - `false` to omit comments in the output - a valid JS RegExp like `/foo/` or `/^!/` to keep only matching comments. Note that currently not *all* comments can be kept when compression is on, because of dead code removal or cascading statements into sequences. In minified gr-app.js version we don't need to preserve license information and can remove it. This saves ca. 300KB in gr-app.js size. [1] https://github.com/terser/terser Bug: Issue 13870 Change-Id: I2736879d252994200ad2f52e414e224ebe56b65d
-rw-r--r--polygerrit-ui/app/rollup.config.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/polygerrit-ui/app/rollup.config.js b/polygerrit-ui/app/rollup.config.js
index d83f24fb25..cfc8c015fd 100644
--- a/polygerrit-ui/app/rollup.config.js
+++ b/polygerrit-ui/app/rollup.config.js
@@ -75,7 +75,13 @@ export default {
output: {
format: 'iife',
compact: true,
- plugins: [terser()]
+ plugins: [
+ terser({
+ output: {
+ comments: false
+ }
+ })
+ ]
},
//Context must be set to window to correctly processing global variables
context: 'window',