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";