hadars 0.1.37 → 0.1.38

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 CHANGED
@@ -1314,6 +1314,10 @@ var buildCompilerConfig = (entry, opts, includeHotPlugin) => {
1314
1314
  compilation.hooks.childCompiler.tap(
1315
1315
  "HadarsWorkerChunkLoading",
1316
1316
  (childCompiler) => {
1317
+ const libType = childCompiler.options?.output?.library?.type;
1318
+ if (libType === "module" || libType === "commonjs" || libType === "commonjs2") {
1319
+ return;
1320
+ }
1317
1321
  if (childCompiler.options?.output) {
1318
1322
  childCompiler.options.output.chunkLoading = "import-scripts";
1319
1323
  }
package/dist/ssr-watch.js CHANGED
@@ -215,6 +215,10 @@ var buildCompilerConfig = (entry2, opts, includeHotPlugin) => {
215
215
  compilation.hooks.childCompiler.tap(
216
216
  "HadarsWorkerChunkLoading",
217
217
  (childCompiler) => {
218
+ const libType = childCompiler.options?.output?.library?.type;
219
+ if (libType === "module" || libType === "commonjs" || libType === "commonjs2") {
220
+ return;
221
+ }
218
222
  if (childCompiler.options?.output) {
219
223
  childCompiler.options.output.chunkLoading = "import-scripts";
220
224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hadars",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Minimal SSR framework for React — rspack, HMR, TypeScript, Bun/Node/Deno",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",
@@ -278,6 +278,15 @@ const buildCompilerConfig = (
278
278
  compilation.hooks.childCompiler.tap(
279
279
  'HadarsWorkerChunkLoading',
280
280
  (childCompiler: any) => {
281
+ // Skip internal rspack child compilers that already have an
282
+ // explicit library type (e.g. HtmlRspackPlugin template
283
+ // compilations use library: { type: 'module', name: '' }).
284
+ // Forcing outputModule:false on those triggers the rspack
285
+ // ModuleLibraryPlugin "name can't be empty" panic in production.
286
+ const libType = childCompiler.options?.output?.library?.type;
287
+ if (libType === 'module' || libType === 'commonjs' || libType === 'commonjs2') {
288
+ return;
289
+ }
281
290
  if (childCompiler.options?.output) {
282
291
  childCompiler.options.output.chunkLoading = 'import-scripts';
283
292
  }