@kbach/react 0.5.41 → 0.5.42
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.
- package/dist/vite-plugin.js +7 -2
- package/dist/vite-plugin.mjs +7 -2
- package/package.json +1 -1
package/dist/vite-plugin.js
CHANGED
|
@@ -2805,6 +2805,10 @@ var customVariants = new Proxy(
|
|
|
2805
2805
|
);
|
|
2806
2806
|
|
|
2807
2807
|
// src/vite-plugin.ts
|
|
2808
|
+
function normPath(p) {
|
|
2809
|
+
const fwd = p.replace(/\\/g, "/");
|
|
2810
|
+
return process.platform === "win32" ? fwd.toLowerCase() : fwd;
|
|
2811
|
+
}
|
|
2808
2812
|
setCSSGenMode(true);
|
|
2809
2813
|
var KBACH_START = "/* kbach:start */";
|
|
2810
2814
|
var KBACH_END = "/* kbach:end */";
|
|
@@ -2973,6 +2977,7 @@ function kbach(userConfig) {
|
|
|
2973
2977
|
const fileTokens = /* @__PURE__ */ new Map();
|
|
2974
2978
|
const tokenCSS = /* @__PURE__ */ new Map();
|
|
2975
2979
|
function processFile(filePath, code) {
|
|
2980
|
+
const key = normPath(filePath);
|
|
2976
2981
|
const tokens = /* @__PURE__ */ new Set();
|
|
2977
2982
|
for (const cls of extractClassStrings(code)) {
|
|
2978
2983
|
for (const tok of splitClassTokens(cls)) {
|
|
@@ -2982,7 +2987,7 @@ function kbach(userConfig) {
|
|
|
2982
2987
|
}
|
|
2983
2988
|
}
|
|
2984
2989
|
}
|
|
2985
|
-
fileTokens.set(
|
|
2990
|
+
fileTokens.set(key, tokens);
|
|
2986
2991
|
}
|
|
2987
2992
|
function buildTokenCSSView() {
|
|
2988
2993
|
const active = /* @__PURE__ */ new Set();
|
|
@@ -3018,7 +3023,7 @@ function kbach(userConfig) {
|
|
|
3018
3023
|
try {
|
|
3019
3024
|
processFile(file, (0, import_fs.readFileSync)(file, "utf-8"));
|
|
3020
3025
|
} catch {
|
|
3021
|
-
fileTokens.delete(file);
|
|
3026
|
+
fileTokens.delete(normPath(file));
|
|
3022
3027
|
}
|
|
3023
3028
|
if (mainCSSFile) writeKbachToFile(mainCSSFile, generateCSS());
|
|
3024
3029
|
}
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -8,6 +8,10 @@ import {
|
|
|
8
8
|
// src/vite-plugin.ts
|
|
9
9
|
import { readFileSync, writeFileSync, existsSync, readdirSync, statSync } from "fs";
|
|
10
10
|
import { join } from "path";
|
|
11
|
+
function normPath(p) {
|
|
12
|
+
const fwd = p.replace(/\\/g, "/");
|
|
13
|
+
return process.platform === "win32" ? fwd.toLowerCase() : fwd;
|
|
14
|
+
}
|
|
11
15
|
setCSSGenMode(true);
|
|
12
16
|
var KBACH_START = "/* kbach:start */";
|
|
13
17
|
var KBACH_END = "/* kbach:end */";
|
|
@@ -176,6 +180,7 @@ function kbach(userConfig) {
|
|
|
176
180
|
const fileTokens = /* @__PURE__ */ new Map();
|
|
177
181
|
const tokenCSS = /* @__PURE__ */ new Map();
|
|
178
182
|
function processFile(filePath, code) {
|
|
183
|
+
const key = normPath(filePath);
|
|
179
184
|
const tokens = /* @__PURE__ */ new Set();
|
|
180
185
|
for (const cls of extractClassStrings(code)) {
|
|
181
186
|
for (const tok of splitClassTokens(cls)) {
|
|
@@ -185,7 +190,7 @@ function kbach(userConfig) {
|
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
192
|
}
|
|
188
|
-
fileTokens.set(
|
|
193
|
+
fileTokens.set(key, tokens);
|
|
189
194
|
}
|
|
190
195
|
function buildTokenCSSView() {
|
|
191
196
|
const active = /* @__PURE__ */ new Set();
|
|
@@ -221,7 +226,7 @@ function kbach(userConfig) {
|
|
|
221
226
|
try {
|
|
222
227
|
processFile(file, readFileSync(file, "utf-8"));
|
|
223
228
|
} catch {
|
|
224
|
-
fileTokens.delete(file);
|
|
229
|
+
fileTokens.delete(normPath(file));
|
|
225
230
|
}
|
|
226
231
|
if (mainCSSFile) writeKbachToFile(mainCSSFile, generateCSS());
|
|
227
232
|
}
|