From e8129167c76104d59d31a77b16dff3458e6af5eb Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 20 Jan 2025 20:40:28 +0530 Subject: [PATCH] fix(build): escape `$` in replace pattern in dynamic routes plugin closes #4499 --- src/node/plugins/dynamicRoutesPlugin.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/plugins/dynamicRoutesPlugin.ts b/src/node/plugins/dynamicRoutesPlugin.ts index 9d0d1dbd..11f4b64e 100644 --- a/src/node/plugins/dynamicRoutesPlugin.ts +++ b/src/node/plugins/dynamicRoutesPlugin.ts @@ -132,7 +132,10 @@ export const dynamicRoutesPlugin = async ( // we use a special injection syntax so the content is rendered as // static local content instead of included as runtime data. if (content) { - baseContent = baseContent.replace(//, content) + baseContent = baseContent.replace( + //, + content.replace(/\$/g, '$$$') + ) } // params are injected with special markers and extracted as part of