hadars 0.1.38 → 0.1.39-rc.1
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 +3 -7
- package/dist/ssr-watch.js +3 -7
- package/package.json +1 -1
- package/src/utils/rspack.ts +15 -12
package/dist/cli.js
CHANGED
|
@@ -1314,16 +1314,12 @@ var buildCompilerConfig = (entry, opts, includeHotPlugin) => {
|
|
|
1314
1314
|
compilation.hooks.childCompiler.tap(
|
|
1315
1315
|
"HadarsWorkerChunkLoading",
|
|
1316
1316
|
(childCompiler) => {
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
}
|
|
1317
|
+
const lib = childCompiler.options?.output?.library;
|
|
1318
|
+
const libType = typeof lib === "string" ? lib : lib?.type;
|
|
1319
|
+
if (libType) return;
|
|
1321
1320
|
if (childCompiler.options?.output) {
|
|
1322
1321
|
childCompiler.options.output.chunkLoading = "import-scripts";
|
|
1323
1322
|
}
|
|
1324
|
-
if (childCompiler.options?.experiments) {
|
|
1325
|
-
childCompiler.options.experiments.outputModule = false;
|
|
1326
|
-
}
|
|
1327
1323
|
}
|
|
1328
1324
|
);
|
|
1329
1325
|
});
|
package/dist/ssr-watch.js
CHANGED
|
@@ -215,16 +215,12 @@ var buildCompilerConfig = (entry2, opts, includeHotPlugin) => {
|
|
|
215
215
|
compilation.hooks.childCompiler.tap(
|
|
216
216
|
"HadarsWorkerChunkLoading",
|
|
217
217
|
(childCompiler) => {
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
218
|
+
const lib = childCompiler.options?.output?.library;
|
|
219
|
+
const libType = typeof lib === "string" ? lib : lib?.type;
|
|
220
|
+
if (libType) return;
|
|
222
221
|
if (childCompiler.options?.output) {
|
|
223
222
|
childCompiler.options.output.chunkLoading = "import-scripts";
|
|
224
223
|
}
|
|
225
|
-
if (childCompiler.options?.experiments) {
|
|
226
|
-
childCompiler.options.experiments.outputModule = false;
|
|
227
|
-
}
|
|
228
224
|
}
|
|
229
225
|
);
|
|
230
226
|
});
|
package/package.json
CHANGED
package/src/utils/rspack.ts
CHANGED
|
@@ -278,21 +278,24 @@ const buildCompilerConfig = (
|
|
|
278
278
|
compilation.hooks.childCompiler.tap(
|
|
279
279
|
'HadarsWorkerChunkLoading',
|
|
280
280
|
(childCompiler: any) => {
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
281
|
+
// Only target child compilers that have no explicit library
|
|
282
|
+
// configuration — those are the ones rspack creates for
|
|
283
|
+
// `new Worker(new URL(...))` entries. Internal rspack child
|
|
284
|
+
// compilers (HtmlRspackPlugin, chunk-splitting, etc.) carry a
|
|
285
|
+
// library config (often { type: 'module', name: '' }) and
|
|
286
|
+
// must be left untouched: forcing outputModule:false on them
|
|
287
|
+
// while library.type === 'module' triggers the rspack
|
|
288
|
+
// ModuleLibraryPlugin "name can't be empty" panic.
|
|
289
|
+
// NOTE: we intentionally do NOT set experiments.outputModule
|
|
290
|
+
// here — that field lives on internal compilations and
|
|
291
|
+
// modifying it is what causes the panic. Setting
|
|
292
|
+
// chunkLoading alone is sufficient to fix classic workers.
|
|
293
|
+
const lib = childCompiler.options?.output?.library;
|
|
294
|
+
const libType = typeof lib === 'string' ? lib : lib?.type;
|
|
295
|
+
if (libType) return;
|
|
290
296
|
if (childCompiler.options?.output) {
|
|
291
297
|
childCompiler.options.output.chunkLoading = 'import-scripts';
|
|
292
298
|
}
|
|
293
|
-
if (childCompiler.options?.experiments) {
|
|
294
|
-
childCompiler.options.experiments.outputModule = false;
|
|
295
|
-
}
|
|
296
299
|
},
|
|
297
300
|
);
|
|
298
301
|
});
|