mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-03 06:07:19 +02:00
Minify SVG in generated JS
This commit is contained in:
parent
4888c399f0
commit
9f46eca956
7
build.ts
7
build.ts
@ -35,6 +35,13 @@ const postProcess = (str: string): string => {
|
||||
// Add ADDITIONAL CODE block
|
||||
str = str.replace('var DEFAULT_FLAGS', '\n/* ADDITIONAL CODE */\n\nvar DEFAULT_FLAGS');
|
||||
|
||||
// Minify SVG
|
||||
str = str.replaceAll(/= "(<svg.*)";/g, function(match) {
|
||||
match = match.replaceAll(/\\n*\s*/g, '');
|
||||
return match;
|
||||
});
|
||||
|
||||
|
||||
assert(str.includes('/* ADDITIONAL CODE */'));
|
||||
assert(str.includes('window.BX_EXPOSED = BxExposed'));
|
||||
assert(str.includes('window.BxEvent = BxEvent'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user