From eac3aff6362fab0a896e37d7563b255ddcd45779 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Wed, 5 Aug 2020 09:01:03 +0200 Subject: [PATCH 1/2] wip temp terser config to not obfuscated API The default terser options minified everything, including class and function names which prevent to use the bundle in the examples. --- rollup.config.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 30deaa25d1..13115676af 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -73,7 +73,36 @@ if (devMode) { } if (demoMode) { - plugins.push(terser()); + plugins.push( + terser({ + compress: false, + // TODO test collapse_vars = false + + // compress: { + // ecma: 6, + // // keep_classnames: true, + // // keep_fnames: true, + // }, + // named 'format' in newer versions + output: { + ecma: 6, + }, + parse: { + ecma: 6, + }, + mangle: false, + // mangle: { + // keep_classnames: true, + // keep_fnames: true, + // }, + ecma: 6, + module: true, + // eslint-disable-next-line @typescript-eslint/camelcase + keep_classnames: true, // + // eslint-disable-next-line @typescript-eslint/camelcase + keep_fnames: true, // + }), + ); } export default { From b7f00c50bd43261c5b572d96d9cb6e54d77f2e4b Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 6 Aug 2020 11:49:46 +0200 Subject: [PATCH 2/2] clean terser config: keep minimal configuration --- rollup.config.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 4fb7d37651..06e73f6c53 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -77,31 +77,8 @@ if (demoMode) { plugins.push( terser({ compress: false, - // TODO test collapse_vars = false - - // compress: { - // ecma: 6, - // // keep_classnames: true, - // // keep_fnames: true, - // }, - // named 'format' in newer versions - output: { - ecma: 6, - }, - parse: { - ecma: 6, - }, mangle: false, - // mangle: { - // keep_classnames: true, - // keep_fnames: true, - // }, ecma: 6, - module: true, - // eslint-disable-next-line @typescript-eslint/camelcase - keep_classnames: true, // - // eslint-disable-next-line @typescript-eslint/camelcase - keep_fnames: true, // }), ); }