hadars 0.1.12 → 0.1.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/dist/cli.js +8 -8
- package/dist/ssr-watch.js +8 -8
- package/package.json +1 -1
- package/src/utils/rspack.ts +10 -8
package/dist/cli.js
CHANGED
|
@@ -534,6 +534,12 @@ var buildCompilerConfig = (entry, opts, includeHotPlugin) => {
|
|
|
534
534
|
experiments: {
|
|
535
535
|
...localConfig.experiments || {},
|
|
536
536
|
outputModule: isServerBuild
|
|
537
|
+
},
|
|
538
|
+
// Prevent rspack from watching its own build output — without this the
|
|
539
|
+
// SSR watcher writing .hadars/index.ssr.js triggers the client compiler
|
|
540
|
+
// and vice versa, causing an infinite rebuild loop.
|
|
541
|
+
watchOptions: {
|
|
542
|
+
ignored: ["**/node_modules/**", "**/.hadars/**"]
|
|
537
543
|
}
|
|
538
544
|
};
|
|
539
545
|
};
|
|
@@ -545,7 +551,7 @@ var compileEntry = async (entry, opts) => {
|
|
|
545
551
|
if (opts.watch) {
|
|
546
552
|
await new Promise((resolve2, reject) => {
|
|
547
553
|
let first = true;
|
|
548
|
-
compiler.watch({}, (err, stats) => {
|
|
554
|
+
compiler.watch({ ignored: ["**/node_modules/**", "**/.hadars/**"] }, (err, stats) => {
|
|
549
555
|
if (err) {
|
|
550
556
|
if (first) {
|
|
551
557
|
first = false;
|
|
@@ -555,13 +561,7 @@ var compileEntry = async (entry, opts) => {
|
|
|
555
561
|
}
|
|
556
562
|
return;
|
|
557
563
|
}
|
|
558
|
-
console.log(stats?.toString({
|
|
559
|
-
colors: true,
|
|
560
|
-
modules: true,
|
|
561
|
-
children: true,
|
|
562
|
-
chunks: true,
|
|
563
|
-
chunkModules: true
|
|
564
|
-
}));
|
|
564
|
+
console.log(stats?.toString({ colors: true }));
|
|
565
565
|
if (first) {
|
|
566
566
|
first = false;
|
|
567
567
|
resolve2(stats);
|
package/dist/ssr-watch.js
CHANGED
|
@@ -260,6 +260,12 @@ var buildCompilerConfig = (entry2, opts, includeHotPlugin) => {
|
|
|
260
260
|
experiments: {
|
|
261
261
|
...localConfig.experiments || {},
|
|
262
262
|
outputModule: isServerBuild
|
|
263
|
+
},
|
|
264
|
+
// Prevent rspack from watching its own build output — without this the
|
|
265
|
+
// SSR watcher writing .hadars/index.ssr.js triggers the client compiler
|
|
266
|
+
// and vice versa, causing an infinite rebuild loop.
|
|
267
|
+
watchOptions: {
|
|
268
|
+
ignored: ["**/node_modules/**", "**/.hadars/**"]
|
|
263
269
|
}
|
|
264
270
|
};
|
|
265
271
|
};
|
|
@@ -268,7 +274,7 @@ var compileEntry = async (entry2, opts) => {
|
|
|
268
274
|
if (opts.watch) {
|
|
269
275
|
await new Promise((resolve, reject) => {
|
|
270
276
|
let first = true;
|
|
271
|
-
compiler.watch({}, (err, stats) => {
|
|
277
|
+
compiler.watch({ ignored: ["**/node_modules/**", "**/.hadars/**"] }, (err, stats) => {
|
|
272
278
|
if (err) {
|
|
273
279
|
if (first) {
|
|
274
280
|
first = false;
|
|
@@ -278,13 +284,7 @@ var compileEntry = async (entry2, opts) => {
|
|
|
278
284
|
}
|
|
279
285
|
return;
|
|
280
286
|
}
|
|
281
|
-
console.log(stats?.toString({
|
|
282
|
-
colors: true,
|
|
283
|
-
modules: true,
|
|
284
|
-
children: true,
|
|
285
|
-
chunks: true,
|
|
286
|
-
chunkModules: true
|
|
287
|
-
}));
|
|
287
|
+
console.log(stats?.toString({ colors: true }));
|
|
288
288
|
if (first) {
|
|
289
289
|
first = false;
|
|
290
290
|
resolve(stats);
|
package/package.json
CHANGED
package/src/utils/rspack.ts
CHANGED
|
@@ -314,6 +314,12 @@ const buildCompilerConfig = (
|
|
|
314
314
|
...(localConfig.experiments || {}),
|
|
315
315
|
outputModule: isServerBuild,
|
|
316
316
|
},
|
|
317
|
+
// Prevent rspack from watching its own build output — without this the
|
|
318
|
+
// SSR watcher writing .hadars/index.ssr.js triggers the client compiler
|
|
319
|
+
// and vice versa, causing an infinite rebuild loop.
|
|
320
|
+
watchOptions: {
|
|
321
|
+
ignored: ['**/node_modules/**', '**/.hadars/**'],
|
|
322
|
+
},
|
|
317
323
|
};
|
|
318
324
|
};
|
|
319
325
|
|
|
@@ -335,20 +341,16 @@ export const compileEntry = async (entry: string, opts: EntryOptions & { watch?:
|
|
|
335
341
|
if (opts.watch) {
|
|
336
342
|
await new Promise((resolve, reject) => {
|
|
337
343
|
let first = true;
|
|
338
|
-
compiler.watch(
|
|
344
|
+
// Pass ignored patterns directly — compiler.watch(watchOptions) replaces
|
|
345
|
+
// the config-level watchOptions, so we must repeat them here.
|
|
346
|
+
compiler.watch({ ignored: ['**/node_modules/**', '**/.hadars/**'] }, (err: any, stats: any) => {
|
|
339
347
|
if (err) {
|
|
340
348
|
if (first) { first = false; reject(err); }
|
|
341
349
|
else { console.error('rspack watch error', err); }
|
|
342
350
|
return;
|
|
343
351
|
}
|
|
344
352
|
|
|
345
|
-
console.log(stats?.toString({
|
|
346
|
-
colors: true,
|
|
347
|
-
modules: true,
|
|
348
|
-
children: true,
|
|
349
|
-
chunks: true,
|
|
350
|
-
chunkModules: true,
|
|
351
|
-
}));
|
|
353
|
+
console.log(stats?.toString({ colors: true }));
|
|
352
354
|
|
|
353
355
|
if (first) {
|
|
354
356
|
first = false;
|