tailwind-styled-v4 5.0.20 → 5.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2540,8 +2540,8 @@ function detectRouter(resourcePath) {
2540
2540
  var NEXT_RSC_ENTRIES = /(?:^|[\\/])(?:layout|page|loading|error|not-found|template|default)\.[jt]sx?$/;
2541
2541
  function isSkippable(resourcePath) {
2542
2542
  const normalized = resourcePath.replace(/\\/g, "/");
2543
- return normalized.includes("/node_modules/") || normalized.endsWith(".d.ts") || normalized.endsWith(".d.mts") || normalized.endsWith(".d.cts") || // Skip CSS/assets
2544
- /\.(css|scss|sass|less|svg|png|jpg|jpeg|gif|webp|ico|woff|woff2|ttf|eot)$/.test(normalized) || // Skip Next.js RSC entry files — Turbopack tidak punya exclude di rule level,
2543
+ return normalized.includes("/node_modules/") || normalized.endsWith(".d.ts") || normalized.endsWith(".d.mts") || normalized.endsWith(".d.cts") || // Skip non-JS files that Turbopack may pass to the loader (no rule-level exclude)
2544
+ /\.(css|scss|sass|less|svg|png|jpg|jpeg|gif|webp|ico|woff|woff2|ttf|eot|md|mdx|txt|yaml|yml|json|tsbuildinfo)$/.test(normalized) || // Skip Next.js RSC entry files — Turbopack tidak punya exclude di rule level,
2545
2545
  // jadi guard ini menggantikan NEXT_RSC_ENTRIES exclude yang ada di webpack path.
2546
2546
  NEXT_RSC_ENTRIES.test(normalized);
2547
2547
  }
@@ -2650,7 +2650,11 @@ function writePerFileSafelist(safelistPath, resourcePath, classes) {
2650
2650
  }
2651
2651
  }
2652
2652
  function turbopackLoader(source, options = {}) {
2653
- if (isSkippable(this.resourcePath)) return source;
2653
+ if (isSkippable(this.resourcePath)) {
2654
+ const isRscEntry = NEXT_RSC_ENTRIES.test(this.resourcePath.replace(/\\/g, "/"));
2655
+ const hasUseClient = /^\s*["'](use client)["']/.test(source);
2656
+ if (!isRscEntry || !hasUseClient) return source;
2657
+ }
2654
2658
  const router = detectRouter(this.resourcePath);
2655
2659
  const nextMajor = parseNum(options.nextMajor);
2656
2660
  const debug = parseBool(options.debug);