From df64f5f826e725db3417740ef484c429423fca1b Mon Sep 17 00:00:00 2001 From: Mani Vazirian Date: Sun, 28 Jan 2024 19:00:08 +0100 Subject: [PATCH] [#133] change replaceAll to replace for NodeJS 14 compatibility (#132) replaceAll is available from Nodejs 15+ But the regex here works also with replace which also guarantees nodejs 14 compatibility --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 81fb90b..7ff1a38 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -301,7 +301,7 @@ export function buildOutputChunkWithCssInjectionCode( cssInjectionCode: string, topExecutionPriorityFlag: boolean ): string { - const appCode = jsAssetCode.replaceAll(/\/\*\s*empty css\s*\*\//g, ''); + const appCode = jsAssetCode.replace(/\/\*\s*empty css\s*\*\//g, ''); jsAssetCode = topExecutionPriorityFlag ? '' : appCode; jsAssetCode += cssInjectionCode; jsAssetCode += !topExecutionPriorityFlag ? '' : appCode;