[Scripts > Strip] Fix RegEx fix breaking not minifying sometimes, fix some unneeded spaces in get imports/exports
This commit is contained in:
parent
88ec90f3d7
commit
dbb9eef558
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ const stripCode = (code) => code
|
||||||
.replaceAll('let ', 'let~')
|
.replaceAll('let ', 'let~')
|
||||||
.replaceAll('var ', 'var~')
|
.replaceAll('var ', 'var~')
|
||||||
.replaceAll('class ', 'class~')
|
.replaceAll('class ', 'class~')
|
||||||
.replaceAll('get ', 'get~')
|
.replace(/get [^=}]/g, _ => _.replaceAll(' ', '~'))
|
||||||
.replaceAll('delete ', 'delete~')
|
.replaceAll('delete ', 'delete~')
|
||||||
.replaceAll(' extends ', '~extends~')
|
.replaceAll(' extends ', '~extends~')
|
||||||
.replaceAll('typeof ', 'typeof~')
|
.replaceAll('typeof ', 'typeof~')
|
||||||
|
@ -24,7 +24,7 @@ const stripCode = (code) => code
|
||||||
.replaceAll('else ', 'else~')
|
.replaceAll('else ', 'else~')
|
||||||
.replaceAll('false', '!1')
|
.replaceAll('false', '!1')
|
||||||
.replaceAll('true', '!0')
|
.replaceAll('true', '!0')
|
||||||
.replace(/((['"`/])[\s\S]*?\2)|[ \n]/g, (_, g1) => g1 || '')
|
.replace(/((['"`])[\s\S]*?\2)|[ \n]/g, (_, g1) => g1 || '')
|
||||||
.replaceAll('~', ' ')
|
.replaceAll('~', ' ')
|
||||||
.replaceAll('? ?', '??');
|
.replaceAll('? ?', '??');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue