tailwind-styled-v4 5.0.8 → 5.0.10

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +204 -416
  2. package/README.md +45 -15
  3. package/dist/{analyzeWorkspace-DuJKh7Ty.d.mts → analyzeWorkspace-BS5O4rhC.d.mts} +47 -2
  4. package/dist/{analyzeWorkspace-Ct_NTAWt.d.ts → analyzeWorkspace-DDOQdzzI.d.ts} +47 -2
  5. package/dist/analyzer.d.mts +5 -3
  6. package/dist/analyzer.d.ts +5 -3
  7. package/dist/analyzer.js +563 -468
  8. package/dist/analyzer.js.map +1 -1
  9. package/dist/analyzer.mjs +562 -467
  10. package/dist/analyzer.mjs.map +1 -1
  11. package/dist/animate.d.mts +4 -7
  12. package/dist/animate.d.ts +4 -7
  13. package/dist/animate.js +171 -265
  14. package/dist/animate.js.map +1 -1
  15. package/dist/animate.mjs +165 -264
  16. package/dist/animate.mjs.map +1 -1
  17. package/dist/atomic.d.mts +22 -1
  18. package/dist/atomic.d.ts +22 -1
  19. package/dist/atomic.js +221 -165
  20. package/dist/atomic.js.map +1 -1
  21. package/dist/atomic.mjs +200 -165
  22. package/dist/atomic.mjs.map +1 -1
  23. package/dist/cli.d.mts +60 -1
  24. package/dist/cli.d.ts +60 -1
  25. package/dist/cli.js +1261 -1517
  26. package/dist/cli.js.map +1 -1
  27. package/dist/cli.mjs +1238 -1513
  28. package/dist/cli.mjs.map +1 -1
  29. package/dist/compiler.d.mts +38 -7
  30. package/dist/compiler.d.ts +38 -7
  31. package/dist/compiler.js +174 -197
  32. package/dist/compiler.js.map +1 -1
  33. package/dist/compiler.mjs +151 -194
  34. package/dist/compiler.mjs.map +1 -1
  35. package/dist/devtools.js +7 -31
  36. package/dist/devtools.js.map +1 -1
  37. package/dist/devtools.mjs +7 -31
  38. package/dist/devtools.mjs.map +1 -1
  39. package/dist/engine.d.mts +134 -63
  40. package/dist/engine.d.ts +134 -63
  41. package/dist/engine.js +2863 -2482
  42. package/dist/engine.js.map +1 -1
  43. package/dist/engine.mjs +2852 -2485
  44. package/dist/engine.mjs.map +1 -1
  45. package/dist/{index-eWAocnD2.d.mts → index-NDINUhLN.d.mts} +3 -1
  46. package/dist/{index-eWAocnD2.d.ts → index-NDINUhLN.d.ts} +3 -1
  47. package/dist/index.d.mts +63 -32
  48. package/dist/index.d.ts +63 -32
  49. package/dist/index.js +335 -169
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +315 -169
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/{liveTokenEngine-DSUk88P6.d.ts → liveTokenEngine-CN9ian1R.d.ts} +1 -1
  54. package/dist/{liveTokenEngine-CX5_0c4q.d.mts → liveTokenEngine-DKoWRtqH.d.mts} +1 -1
  55. package/dist/next.d.mts +10 -4
  56. package/dist/next.d.ts +10 -4
  57. package/dist/next.js +32 -45
  58. package/dist/next.js.map +1 -1
  59. package/dist/next.mjs +30 -43
  60. package/dist/next.mjs.map +1 -1
  61. package/dist/plugin-api.d.mts +8 -2
  62. package/dist/plugin-api.d.ts +8 -2
  63. package/dist/plugin-api.js +14 -2
  64. package/dist/plugin-api.js.map +1 -1
  65. package/dist/plugin-api.mjs +14 -3
  66. package/dist/plugin-api.mjs.map +1 -1
  67. package/dist/plugin-registry.js +51 -11
  68. package/dist/plugin-registry.js.map +1 -1
  69. package/dist/plugin-registry.mjs +51 -11
  70. package/dist/plugin-registry.mjs.map +1 -1
  71. package/dist/plugin.d.mts +5 -7
  72. package/dist/plugin.d.ts +5 -7
  73. package/dist/plugin.js +16 -15
  74. package/dist/plugin.js.map +1 -1
  75. package/dist/plugin.mjs +16 -16
  76. package/dist/plugin.mjs.map +1 -1
  77. package/dist/rspack.js +17 -38
  78. package/dist/rspack.js.map +1 -1
  79. package/dist/rspack.mjs +15 -36
  80. package/dist/rspack.mjs.map +1 -1
  81. package/dist/runtime.d.mts +2 -2
  82. package/dist/runtime.d.ts +2 -2
  83. package/dist/scanner.d.mts +10 -1
  84. package/dist/scanner.d.ts +10 -1
  85. package/dist/scanner.js +298 -124
  86. package/dist/scanner.js.map +1 -1
  87. package/dist/scanner.mjs +296 -124
  88. package/dist/scanner.mjs.map +1 -1
  89. package/dist/shared.d.mts +1 -1
  90. package/dist/shared.d.ts +1 -1
  91. package/dist/shared.js +104 -176
  92. package/dist/shared.js.map +1 -1
  93. package/dist/shared.mjs +85 -176
  94. package/dist/shared.mjs.map +1 -1
  95. package/dist/storybook-addon.d.mts +1 -1
  96. package/dist/storybook-addon.d.ts +1 -1
  97. package/dist/svelte.d.mts +1 -1
  98. package/dist/svelte.d.ts +1 -1
  99. package/dist/svelte.js +166 -3
  100. package/dist/svelte.js.map +1 -1
  101. package/dist/svelte.mjs +143 -1
  102. package/dist/svelte.mjs.map +1 -1
  103. package/dist/syntax.js +21 -21
  104. package/dist/syntax.js.map +1 -1
  105. package/dist/syntax.mjs +21 -21
  106. package/dist/syntax.mjs.map +1 -1
  107. package/dist/testing.js +9 -1
  108. package/dist/testing.js.map +1 -1
  109. package/dist/testing.mjs +9 -1
  110. package/dist/testing.mjs.map +1 -1
  111. package/dist/theme.d.mts +2 -2
  112. package/dist/theme.d.ts +2 -2
  113. package/dist/theme.js +40 -112
  114. package/dist/theme.js.map +1 -1
  115. package/dist/theme.mjs +37 -110
  116. package/dist/theme.mjs.map +1 -1
  117. package/dist/turbopackLoader.js +84 -126
  118. package/dist/turbopackLoader.js.map +1 -1
  119. package/dist/turbopackLoader.mjs +68 -124
  120. package/dist/turbopackLoader.mjs.map +1 -1
  121. package/dist/tw.js +1256 -1517
  122. package/dist/tw.js.map +1 -1
  123. package/dist/tw.mjs +1236 -1513
  124. package/dist/tw.mjs.map +1 -1
  125. package/dist/vite.js +1783 -823
  126. package/dist/vite.js.map +1 -1
  127. package/dist/vite.mjs +1767 -821
  128. package/dist/vite.mjs.map +1 -1
  129. package/dist/vue.d.mts +1 -1
  130. package/dist/vue.d.ts +1 -1
  131. package/dist/vue.js +165 -4
  132. package/dist/vue.js.map +1 -1
  133. package/dist/vue.mjs +141 -1
  134. package/dist/vue.mjs.map +1 -1
  135. package/dist/webpackLoader.js +69 -108
  136. package/dist/webpackLoader.js.map +1 -1
  137. package/dist/webpackLoader.mjs +49 -104
  138. package/dist/webpackLoader.mjs.map +1 -1
  139. package/native/tailwind-styled-native.node +0 -0
  140. package/package.json +22 -24
@@ -1,6 +1,10 @@
1
1
  import { createRequire } from 'module';
2
- import fs from 'fs';
3
- import path from 'path';
2
+ import * as fs3 from 'fs';
3
+ import fs3__default from 'fs';
4
+ import * as path from 'path';
5
+ import path__default from 'path';
6
+ import 'crypto';
7
+ import { fileURLToPath } from 'url';
4
8
 
5
9
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
6
10
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -13,45 +17,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
13
17
  var __esm = (fn, res) => function __init() {
14
18
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
19
  };
16
-
17
- // packages/domain/shared/src/native-resolution.ts
18
- function getNodeModuleRef() {
19
- if (isBrowser) return null;
20
- if (nodeModuleRef !== null) return nodeModuleRef;
21
- try {
22
- const test = typeof __require === "function" ? __require("module") : null;
23
- nodeModuleRef = test;
24
- return test;
25
- } catch {
26
- nodeModuleRef = null;
27
- return null;
28
- }
29
- }
30
- function getNodeFs() {
31
- if (isBrowser) return { existsSync: () => false };
32
- const nodeRequire = getNodeModuleRef();
33
- if (!nodeRequire) return { existsSync: () => false };
34
- if (!_nodeFs) _nodeFs = nodeRequire.createRequire(import.meta.url)("node:fs");
35
- return _nodeFs;
36
- }
37
- function getNodePath() {
38
- if (isBrowser) return { resolve: () => "", dirname: "" };
39
- const nodeRequire = getNodeModuleRef();
40
- if (!nodeRequire) return { resolve: () => "", dirname: "" };
41
- if (!_nodePath) _nodePath = nodeRequire.createRequire(import.meta.url)("node:path");
42
- return _nodePath;
43
- }
44
- function getRequire(_importMetaUrl) {
45
- if (isBrowser) return () => {
46
- throw new Error("node:module not available");
47
- };
48
- const nodeRequire = getNodeModuleRef();
49
- if (!nodeRequire) return () => {
50
- throw new Error("require not available");
51
- };
52
- if (!_require) _require = nodeRequire.createRequire(_importMetaUrl);
53
- return _require;
54
- }
55
20
  function platformKey() {
56
21
  if (isBrowser) return "browser";
57
22
  return `${process.platform}-${process.arch}`;
@@ -62,24 +27,21 @@ function resolveNativeBinary(runtimeDir) {
62
27
  if (isBrowser) {
63
28
  return { path: null, source: "not-found", platform, tried: ["not available in browser"] };
64
29
  }
65
- const fs2 = getNodeFs();
66
- const path2 = getNodePath();
67
- const _req = getRequire(import.meta.url);
30
+ if (process.env.TWS_DISABLE_NATIVE === "1") {
31
+ return { path: null, source: "not-found", platform, tried: [] };
32
+ }
68
33
  const envPath = process.env.TW_NATIVE_PATH?.trim();
69
34
  if (envPath) {
70
- if (fs2.existsSync(envPath)) {
35
+ if (fs3.existsSync(envPath)) {
71
36
  return { path: envPath, source: "env", platform, tried };
72
37
  }
73
38
  tried.push(`env:${envPath} (not found)`);
74
39
  }
75
- if (process.env.TWS_NO_NATIVE === "1" || process.env.TWS_NO_RUST === "1" || process.env.TWS_DISABLE_NATIVE === "1") {
76
- return { path: null, source: "not-found", platform, tried: ["disabled by env"] };
77
- }
78
40
  const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
79
41
  for (const pkg of prebuiltPkgs) {
80
42
  try {
81
- const candidate = _req.resolve(`${pkg}/tailwind_styled_parser.node`);
82
- if (fs2.existsSync(candidate)) {
43
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
44
+ if (fs3.existsSync(candidate)) {
83
45
  return { path: candidate, source: "prebuilt", platform, tried };
84
46
  }
85
47
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -89,30 +51,43 @@ function resolveNativeBinary(runtimeDir) {
89
51
  }
90
52
  const cwd = process.cwd();
91
53
  const base = runtimeDir ?? cwd;
92
- const localCandidates = [
93
- path2.resolve(base, "tailwind_styled_parser.node"),
94
- path2.resolve(base, "..", "tailwind_styled_parser.node"),
95
- path2.resolve(cwd, "native", "tailwind_styled_parser.node"),
96
- path2.resolve(cwd, "native", "target", "release", "tailwind_styled_parser.node"),
97
- // napi-rs conventional output
98
- path2.resolve(base, `tailwind_styled_parser.${platform}.node`)
99
- ];
54
+ const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
55
+ const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
56
+ const localCandidates = [];
57
+ for (const bin of BINARY_NAMES) {
58
+ localCandidates.push(path.resolve(base, `${bin}.node`));
59
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
60
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
61
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
62
+ }
63
+ for (const startDir of [cwd, base]) {
64
+ let dir = startDir;
65
+ for (let i = 0; i < 6; i++) {
66
+ const nativeDir = path.resolve(dir, "native");
67
+ for (const bin of BINARY_NAMES) {
68
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
69
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
70
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
71
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
72
+ }
73
+ const parent = path.resolve(dir, "..");
74
+ if (parent === dir) break;
75
+ dir = parent;
76
+ }
77
+ }
100
78
  for (const candidate of localCandidates) {
101
79
  tried.push(`local:${candidate}`);
102
- if (fs2.existsSync(candidate)) {
80
+ if (fs3.existsSync(candidate)) {
103
81
  return { path: candidate, source: "local", platform, tried };
104
82
  }
105
83
  }
106
84
  return { path: null, source: "not-found", platform, tried };
107
85
  }
108
- var isBrowser, nodeModuleRef, _nodeFs, _nodePath, _require, PLATFORM_MAP;
86
+ var isBrowser, _require, PLATFORM_MAP;
109
87
  var init_native_resolution = __esm({
110
88
  "packages/domain/shared/src/native-resolution.ts"() {
111
89
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
112
- nodeModuleRef = null;
113
- _nodeFs = null;
114
- _nodePath = null;
115
- _require = null;
90
+ _require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
116
91
  PLATFORM_MAP = {
117
92
  "linux-x64": ["@tailwind-styled/native-linux-x64"],
118
93
  "linux-arm64": ["@tailwind-styled/native-linux-arm64"],
@@ -123,59 +98,26 @@ var init_native_resolution = __esm({
123
98
  };
124
99
  }
125
100
  });
126
-
127
- // packages/domain/shared/src/index.ts
128
- function getNodeModuleRef2() {
129
- if (isBrowser2) return null;
130
- if (nodeModuleRef2 !== null) return nodeModuleRef2;
131
- try {
132
- const test = typeof __require === "function" ? __require("module") : null;
133
- nodeModuleRef2 = test;
134
- return test;
135
- } catch {
136
- nodeModuleRef2 = null;
137
- return null;
138
- }
139
- }
140
- function getNodeUrl() {
141
- if (isBrowser2) throw new Error("node:url not available in browser");
142
- const nodeRequire = getNodeModuleRef2();
143
- if (!nodeRequire) throw new Error("require not available");
144
- if (!_nodeUrl) _nodeUrl = nodeRequire.createRequire(import.meta.url)("node:url");
145
- return _nodeUrl;
146
- }
147
- function getRequire2() {
148
- if (isBrowser2) return (() => {
149
- throw new Error("require not available in browser");
150
- });
151
- const nodeRequire = getNodeModuleRef2();
152
- if (!nodeRequire) return (() => {
153
- throw new Error("require not available");
154
- });
155
- return nodeRequire.createRequire(import.meta.url);
156
- }
157
101
  function resolveRuntimeDir(dir, importMetaUrl) {
158
- if (isBrowser2) return "";
159
102
  try {
160
- return getNodeUrl().fileURLToPath(importMetaUrl);
103
+ return path__default.dirname(fileURLToPath(importMetaUrl));
161
104
  } catch {
162
105
  return process.cwd();
163
106
  }
164
107
  }
165
- var isBrowser2, nodeModuleRef2, _nodeUrl;
166
108
  var init_src = __esm({
167
109
  "packages/domain/shared/src/index.ts"() {
168
110
  init_native_resolution();
169
- isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
170
- nodeModuleRef2 = null;
171
- _nodeUrl = null;
172
- getRequire2();
111
+ createRequire(import.meta.url);
173
112
  }
174
113
  });
175
- var log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge;
114
+
115
+ // packages/domain/compiler/src/nativeBridge.ts
116
+ var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge;
176
117
  var init_nativeBridge = __esm({
177
118
  "packages/domain/compiler/src/nativeBridge.ts"() {
178
119
  init_src();
120
+ _loadNative = (path4) => __require(path4);
179
121
  log = (...args) => {
180
122
  if (process.env.DEBUG?.includes("compiler:native")) {
181
123
  console.log("[compiler:native]", ...args);
@@ -202,11 +144,10 @@ var init_nativeBridge = __esm({
202
144
  bridgeLoadAttempted = true;
203
145
  try {
204
146
  const runtimeDir = resolveRuntimeDir(void 0, import.meta.url);
205
- const require2 = createRequire(import.meta.url);
206
147
  const result = resolveNativeBinary(runtimeDir);
207
148
  if (result.path && result.path.endsWith(".node")) {
208
149
  try {
209
- const binding = require2(result.path);
150
+ const binding = _loadNative(result.path);
210
151
  if (isValidNativeBridge(binding)) {
211
152
  nativeBridge = binding;
212
153
  log("Native bridge loaded successfully from:", result.path);
@@ -256,7 +197,7 @@ var runLoaderTransform = (ctx) => {
256
197
  classes: result?.classes || []
257
198
  };
258
199
  };
259
- var registerFileClasses = (filepath, classes) => {
200
+ var registerFileClasses = (_filepath, _classes) => {
260
201
  };
261
202
  function parseBool(val, fallback = false) {
262
203
  if (typeof val === "boolean") return val;
@@ -274,10 +215,13 @@ function detectRouter(resourcePath) {
274
215
  if (/\/pages\//.test(normalized)) return "pages";
275
216
  return "unknown";
276
217
  }
218
+ var NEXT_RSC_ENTRIES = /(?:^|[\\/])(?:layout|page|loading|error|not-found|template|default)\.[jt]sx?$/;
277
219
  function isSkippable(resourcePath) {
278
220
  const normalized = resourcePath.replace(/\\/g, "/");
279
221
  return normalized.includes("/node_modules/") || normalized.endsWith(".d.ts") || normalized.endsWith(".d.mts") || normalized.endsWith(".d.cts") || // Skip CSS/assets
280
- /\.(css|scss|sass|less|svg|png|jpg|jpeg|gif|webp|ico|woff|woff2|ttf|eot)$/.test(normalized);
222
+ /\.(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,
223
+ // jadi guard ini menggantikan NEXT_RSC_ENTRIES exclude yang ada di webpack path.
224
+ NEXT_RSC_ENTRIES.test(normalized);
281
225
  }
282
226
  function extractDirective(source) {
283
227
  const match = source.match(/^(\s*["'](use client|use server)["']\s*;?\s*\n?)/);
@@ -290,29 +234,29 @@ var CYCLE_SENTINEL = "_cycle.txt";
290
234
  var START_SENTINEL = "_start.txt";
291
235
  var _workerCache = /* @__PURE__ */ new Map();
292
236
  function getTwClassesDir(safelistPath) {
293
- return path.join(path.dirname(safelistPath), "tw-classes");
237
+ return path__default.join(path__default.dirname(safelistPath), "tw-classes");
294
238
  }
295
239
  function readSentinel(filePath) {
296
240
  try {
297
- return fs.readFileSync(filePath, "utf-8").trim();
241
+ return fs3__default.readFileSync(filePath, "utf-8").trim();
298
242
  } catch {
299
243
  return "";
300
244
  }
301
245
  }
302
246
  function clearAndMarkCycle(twClassesDir, startId) {
303
247
  try {
304
- if (fs.existsSync(twClassesDir)) {
305
- for (const file of fs.readdirSync(twClassesDir)) {
248
+ if (fs3__default.existsSync(twClassesDir)) {
249
+ for (const file of fs3__default.readdirSync(twClassesDir)) {
306
250
  if (file === START_SENTINEL || file === "_webpack-merged.css") continue;
307
251
  try {
308
- fs.unlinkSync(path.join(twClassesDir, file));
252
+ fs3__default.unlinkSync(path__default.join(twClassesDir, file));
309
253
  } catch {
310
254
  }
311
255
  }
312
256
  } else {
313
- fs.mkdirSync(twClassesDir, { recursive: true });
257
+ fs3__default.mkdirSync(twClassesDir, { recursive: true });
314
258
  }
315
- fs.writeFileSync(path.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
259
+ fs3__default.writeFileSync(path__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
316
260
  _workerCache.set(twClassesDir, startId);
317
261
  } catch {
318
262
  }
@@ -320,32 +264,32 @@ function clearAndMarkCycle(twClassesDir, startId) {
320
264
  function getPerFileSafelistPath(safelistDir, resourcePath) {
321
265
  const normalized = resourcePath.replace(/\\/g, "/");
322
266
  const slug = normalized.replace(/^.*\/src\//, "").replace(/\.[tj]sx?$/, "").replace(/[^a-zA-Z0-9]/g, "_").slice(0, 80);
323
- return path.join(safelistDir, `${slug}.css`);
267
+ return path__default.join(safelistDir, `${slug}.css`);
324
268
  }
325
269
  function writePerFileSafelist(safelistPath, resourcePath, classes) {
326
270
  if (!safelistPath || classes.length === 0) return;
327
271
  try {
328
272
  const twClassesDir = getTwClassesDir(safelistPath);
329
- const startId = readSentinel(path.join(twClassesDir, START_SENTINEL));
330
- const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path.join(twClassesDir, CYCLE_SENTINEL));
273
+ const startId = readSentinel(path__default.join(twClassesDir, START_SENTINEL));
274
+ const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path__default.join(twClassesDir, CYCLE_SENTINEL));
331
275
  if (startId && cachedCycle !== startId) {
332
276
  clearAndMarkCycle(twClassesDir, startId);
333
- } else if (!fs.existsSync(twClassesDir)) {
334
- fs.mkdirSync(twClassesDir, { recursive: true });
277
+ } else if (!fs3__default.existsSync(twClassesDir)) {
278
+ fs3__default.mkdirSync(twClassesDir, { recursive: true });
335
279
  }
336
280
  const outPath = getPerFileSafelistPath(twClassesDir, resourcePath);
337
281
  const sorted = [...new Set(classes)].sort();
338
282
  const css = [
339
- `/* tw-safelist: ${path.basename(resourcePath)} \u2014 auto-generated */`,
283
+ `/* tw-safelist: ${path__default.basename(resourcePath)} \u2014 auto-generated */`,
340
284
  "@layer utilities {",
341
285
  sorted.map((cls) => `.${cls.replace(/([^a-zA-Z0-9_-])/g, "\\$1")} {}`).join("\n"),
342
286
  "}"
343
287
  ].join("\n");
344
288
  try {
345
- if (fs.readFileSync(outPath, "utf-8") === css) return;
289
+ if (fs3__default.readFileSync(outPath, "utf-8") === css) return;
346
290
  } catch {
347
291
  }
348
- fs.writeFileSync(outPath, css, "utf-8");
292
+ fs3__default.writeFileSync(outPath, css, "utf-8");
349
293
  } catch {
350
294
  }
351
295
  }
@@ -354,7 +298,7 @@ function turbopackLoader(source, options = {}) {
354
298
  const router = detectRouter(this.resourcePath);
355
299
  const nextMajor = parseNum(options.nextMajor);
356
300
  const debug = parseBool(options.debug);
357
- const filename = path.basename(this.resourcePath);
301
+ const filename = path__default.basename(this.resourcePath);
358
302
  const effective = {
359
303
  addDataAttr: parseBool(options.addDataAttr),
360
304
  // App Router: selalu auto-detect client boundary
@@ -375,7 +319,7 @@ function turbopackLoader(source, options = {}) {
375
319
  source: stripped,
376
320
  options: effective
377
321
  });
378
- if (!output.changed && !output.code.length) return source;
322
+ if (!output.changed) return source;
379
323
  if (output.classes.length > 0) {
380
324
  registerFileClasses(this.resourcePath, output.classes);
381
325
  writePerFileSafelist(options.safelistPath, this.resourcePath, output.classes);