Skip to content

Commit 2a91997

Browse files
authored
compressor.js -- fix
1 parent 2efe97d commit 2a91997

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

src/packager/compressor.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,6 @@
4242
export const optiCompress = (code, options) => {
4343
const builtIns = options.project.analysis.builtInExts;
4444

45-
/* remove fonts */
46-
const fontObjectInd = code.indexOf('{"Sans Serif":');
47-
const fontObjectEnd = code.indexOf('}', fontObjectInd) + 1;
48-
const fontObj = code.substring(fontObjectInd, fontObjectEnd);
49-
50-
const regex = /"([^"]+)"\s*:|([A-Za-z0-9_$]+)\s*:/g;
51-
let count = 0;
52-
while (regex.exec(fontObj)) count++;
53-
54-
const search = code.substring(code.indexOf(',function(A,e)', fontObjectEnd), code.length);
55-
let offset = fontObjectEnd;
56-
for (var i = 0; i < count; i++) {
57-
const fontStart = search.indexOf('{', offset) + (i === 0 ? 16: 0);
58-
const prevEnd = search.indexOf('}', offset) + 1;
59-
offset = search.indexOf('}', prevEnd);
60-
code = code.replace(search.substring(fontStart + 1, offset), '');
61-
}
62-
6345
/* remove some lingering vm comments/spacing */
6446
const vmCommentSec = code.indexOf('+="let stuckCounter = 0;');
6547
const vmCommentSecEnd = code.indexOf('("executeInCompatibilityLayer")&&!e.includes("const waitPromise")');

0 commit comments

Comments
 (0)