[Scripts > Strip] Fix RegEx fix breaking not minifying sometimes, fix some unneeded spaces in get imports/exports

mu
Oj 2 years ago
parent 88ec90f3d7
commit dbb9eef558

@ -7,7 +7,7 @@ const stripCode = (code) => code
.replaceAll('let ', 'let~')
.replaceAll('var ', 'var~')
.replaceAll('class ', 'class~')
.replaceAll('get ', 'get~')
.replace(/get [^=}]/g, _ => _.replaceAll(' ', '~'))
.replaceAll('delete ', 'delete~')
.replaceAll(' extends ', '~extends~')
.replaceAll('typeof ', 'typeof~')
@ -24,7 +24,7 @@ const stripCode = (code) => code
.replaceAll('else ', 'else~')
.replaceAll('false', '!1')
.replaceAll('true', '!0')
.replace(/((['"`/])[\s\S]*?\2)|[ \n]/g, (_, g1) => g1 || '')
.replace(/((['"`])[\s\S]*?\2)|[ \n]/g, (_, g1) => g1 || '')
.replaceAll('~', ' ')
.replaceAll('? ?', '??');

Loading…
Cancel
Save