From 8aa9fce8f593d0a0eda3436b4b58ed486670202e Mon Sep 17 00:00:00 2001 From: Apurv Bazari Date: Sun, 7 Jul 2024 22:16:55 +0530 Subject: [PATCH] fix(integration): Don't update filescope if already set --- packages/integration/src/addFileScope.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/integration/src/addFileScope.ts b/packages/integration/src/addFileScope.ts index de6ccd4dc..a38cc3236 100644 --- a/packages/integration/src/addFileScope.ts +++ b/packages/integration/src/addFileScope.ts @@ -26,12 +26,7 @@ export function addFileScope({ const { hasESM, isMixed } = detectSyntax(source); - if (source.includes('@vanilla-extract/css/fileScope')) { - source = source.replace( - /setFileScope\(((\n|.)*?)\)/, - `setFileScope("${normalizedPath}", "${packageName}")`, - ); - } else { + if (!source.includes('@vanilla-extract/css/fileScope')) { if (hasESM && !isMixed) { source = dedent(` import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";