From fe05518e31eb5a52eec6e359214cf9cf164f8353 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Fri, 20 Dec 2024 22:36:37 +0100 Subject: [PATCH] resolve minify iOS 15/16 compatibility issue --- rollup.config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 4b0d6165..f1cc1377 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -35,13 +35,16 @@ function trimLastSemicolon(input) { } function minifyCode(code) { - const minified = minify(code,{ - compress: true, + const minified = minify(code, { + compress: { + //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2170 + reduce_vars: false, + }, mangle: true, output: { comments: false, beautify: false, - }, + } }); if (minified.error) { @@ -58,7 +61,7 @@ function compressLanguageFile(lang) { return LZString.compressToBase64(minifyCode(`x = ${content};`)); } -const excalidraw_pkg = isLib ? "" : minifyCode( isProd +const excalidraw_pkg = isLib ? "" : minifyCode(isProd ? fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/excalidraw.production.min.js", "utf8") : fs.readFileSync("./node_modules/@zsviczian/excalidraw/dist/excalidraw.development.js", "utf8")); const react_pkg = isLib ? "" : minifyCode(isProd