xatriumcss 1.0.13 → 1.0.14
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/package.json +1 -1
- package/src/cli.js +23 -3
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -96,19 +96,23 @@ function formatTime(nanoseconds) {
|
|
|
96
96
|
|
|
97
97
|
const changedFiles = new Set();
|
|
98
98
|
let rebuildTimer = null;
|
|
99
|
+
let isBuilding = false;
|
|
99
100
|
|
|
100
101
|
function scheduleRebuild() {
|
|
101
|
-
if (rebuildTimer) return;
|
|
102
|
-
|
|
102
|
+
if (rebuildTimer || isBuilding) return;
|
|
103
|
+
|
|
103
104
|
rebuildTimer = setTimeout(() => {
|
|
104
105
|
const files = Array.from(changedFiles);
|
|
105
106
|
changedFiles.clear();
|
|
106
107
|
rebuildTimer = null;
|
|
107
|
-
|
|
108
|
+
|
|
109
|
+
isBuilding = true;
|
|
108
110
|
try {
|
|
109
111
|
build();
|
|
110
112
|
} catch (error) {
|
|
111
113
|
console.error('❌ Build error:', error.message);
|
|
114
|
+
} finally {
|
|
115
|
+
isBuilding = false;
|
|
112
116
|
}
|
|
113
117
|
}, 10);
|
|
114
118
|
}
|
|
@@ -145,6 +149,22 @@ function formatTime(nanoseconds) {
|
|
|
145
149
|
for (const event of events) {
|
|
146
150
|
if (event.type === 'delete') continue;
|
|
147
151
|
|
|
152
|
+
// Normalize paths for comparison
|
|
153
|
+
const normalizedPath = path.normalize(event.path).toLowerCase();
|
|
154
|
+
|
|
155
|
+
// CRITICAL: Ignore output file to prevent infinite loop
|
|
156
|
+
if (normalizedPath === normalizedOutput) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Also ignore the entire output directory
|
|
161
|
+
if (normalizedPath.startsWith(path.dirname(normalizedOutput).toLowerCase())) {
|
|
162
|
+
const isOutputDir = path.dirname(normalizedPath) === path.dirname(normalizedOutput).toLowerCase();
|
|
163
|
+
if (isOutputDir) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
148
168
|
// CRITICAL: Ignore output file to prevent infinite loop
|
|
149
169
|
if (path.resolve(event.path) === path.resolve(config.output)) {
|
|
150
170
|
continue;
|