Set indent of built scripts to 1 space

This commit is contained in:
redphx 2024-10-14 17:14:43 +07:00
parent 927eae3f2f
commit 8e88af5f8c

View File

@ -87,6 +87,15 @@ const postProcess = (str: string): string => {
return p1.toUpperCase();
});
// Replace " (e) =>" to " e =>"
// str = str.replaceAll(/ \(([^\s,.$()]+)\) =>/g, ' $1 =>');
// Set indent to 1 space
str = str.replaceAll(/\n(\s+)/g, (match, p1) => {
const len = p1.length / 2;
return '\n' + ' '.repeat(len);
});
assert(str.includes('/* ADDITIONAL CODE */'));
assert(str.includes('window.BX_EXPOSED = BxExposed'));
assert(str.includes('window.BxEvent = BxEvent'));