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.
@@ -2562,8 +2562,8 @@ function detectRouter(resourcePath) {
2562
2562
  var NEXT_RSC_ENTRIES = /(?:^|[\\/])(?:layout|page|loading|error|not-found|template|default)\.[jt]sx?$/;
2563
2563
  function isSkippable(resourcePath) {
2564
2564
  const normalized = resourcePath.replace(/\\/g, "/");
2565
- return normalized.includes("/node_modules/") || normalized.endsWith(".d.ts") || normalized.endsWith(".d.mts") || normalized.endsWith(".d.cts") || // Skip CSS/assets
2566
- /\.(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,
2565
+ 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)
2566
+ /\.(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,
2567
2567
  // jadi guard ini menggantikan NEXT_RSC_ENTRIES exclude yang ada di webpack path.
2568
2568
  NEXT_RSC_ENTRIES.test(normalized);
2569
2569
  }
@@ -2672,7 +2672,11 @@ function writePerFileSafelist(safelistPath, resourcePath, classes) {
2672
2672
  }
2673
2673
  }
2674
2674
  function turbopackLoader(source, options = {}) {
2675
- if (isSkippable(this.resourcePath)) return source;
2675
+ if (isSkippable(this.resourcePath)) {
2676
+ const isRscEntry = NEXT_RSC_ENTRIES.test(this.resourcePath.replace(/\\/g, "/"));
2677
+ const hasUseClient = /^\s*["'](use client)["']/.test(source);
2678
+ if (!isRscEntry || !hasUseClient) return source;
2679
+ }
2676
2680
  const router = detectRouter(this.resourcePath);
2677
2681
  const nextMajor = parseNum(options.nextMajor);
2678
2682
  const debug = parseBool(options.debug);