Skip to content

Commit

Permalink
resolve minify iOS 15/16 compatibility issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Dec 20, 2024
1 parent 8adcb7d commit fe05518
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit fe05518

Please sign in to comment.