@kbach/react 0.5.31 → 0.5.32
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 +3 -2
- package/dist/vite-plugin.mjs +3 -2
- package/package.json +1 -1
package/dist/vite-plugin.js
CHANGED
|
@@ -3459,6 +3459,7 @@ function toNumericScreens(screens) {
|
|
|
3459
3459
|
}
|
|
3460
3460
|
return out;
|
|
3461
3461
|
}
|
|
3462
|
+
var normPath = (p) => p.split("\\").join("/");
|
|
3462
3463
|
function scanDir(dir, onFile) {
|
|
3463
3464
|
try {
|
|
3464
3465
|
for (const entry of (0, import_fs.readdirSync)(dir)) {
|
|
@@ -3467,7 +3468,7 @@ function scanDir(dir, onFile) {
|
|
|
3467
3468
|
try {
|
|
3468
3469
|
const st = (0, import_fs.statSync)(full);
|
|
3469
3470
|
if (st.isDirectory()) scanDir(full, onFile);
|
|
3470
|
-
else if (/\.(tsx?|jsx?)$/.test(entry)) onFile((0, import_fs.readFileSync)(full, "utf-8"), full);
|
|
3471
|
+
else if (/\.(tsx?|jsx?)$/.test(entry)) onFile((0, import_fs.readFileSync)(full, "utf-8"), normPath(full));
|
|
3471
3472
|
} catch {
|
|
3472
3473
|
}
|
|
3473
3474
|
}
|
|
@@ -3536,7 +3537,7 @@ function kbach(userConfig) {
|
|
|
3536
3537
|
handleHotUpdate({ file }) {
|
|
3537
3538
|
if (file.includes("node_modules") || !/\.(tsx?|jsx?)$/.test(file)) return;
|
|
3538
3539
|
try {
|
|
3539
|
-
fileTokens.set(file, extractTokensFromCode((0, import_fs.readFileSync)(file, "utf-8")));
|
|
3540
|
+
fileTokens.set(normPath(file), extractTokensFromCode((0, import_fs.readFileSync)(file, "utf-8")));
|
|
3540
3541
|
if (rebuildTokenCSS() && mainCSSFile) writeKbachToFile(mainCSSFile, getFormattedCSS());
|
|
3541
3542
|
} catch {
|
|
3542
3543
|
}
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -118,6 +118,7 @@ function toNumericScreens(screens) {
|
|
|
118
118
|
}
|
|
119
119
|
return out;
|
|
120
120
|
}
|
|
121
|
+
var normPath = (p) => p.split("\\").join("/");
|
|
121
122
|
function scanDir(dir, onFile) {
|
|
122
123
|
try {
|
|
123
124
|
for (const entry of readdirSync(dir)) {
|
|
@@ -126,7 +127,7 @@ function scanDir(dir, onFile) {
|
|
|
126
127
|
try {
|
|
127
128
|
const st = statSync(full);
|
|
128
129
|
if (st.isDirectory()) scanDir(full, onFile);
|
|
129
|
-
else if (/\.(tsx?|jsx?)$/.test(entry)) onFile(readFileSync(full, "utf-8"), full);
|
|
130
|
+
else if (/\.(tsx?|jsx?)$/.test(entry)) onFile(readFileSync(full, "utf-8"), normPath(full));
|
|
130
131
|
} catch {
|
|
131
132
|
}
|
|
132
133
|
}
|
|
@@ -195,7 +196,7 @@ function kbach(userConfig) {
|
|
|
195
196
|
handleHotUpdate({ file }) {
|
|
196
197
|
if (file.includes("node_modules") || !/\.(tsx?|jsx?)$/.test(file)) return;
|
|
197
198
|
try {
|
|
198
|
-
fileTokens.set(file, extractTokensFromCode(readFileSync(file, "utf-8")));
|
|
199
|
+
fileTokens.set(normPath(file), extractTokensFromCode(readFileSync(file, "utf-8")));
|
|
199
200
|
if (rebuildTokenCSS() && mainCSSFile) writeKbachToFile(mainCSSFile, getFormattedCSS());
|
|
200
201
|
} catch {
|
|
201
202
|
}
|