@rspack/cli 1.3.0-beta.0 → 1.3.0-beta.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/index.js CHANGED
@@ -440,6 +440,19 @@ var __webpack_exports__ = {};
440
440
  }
441
441
  }
442
442
  const result = compilerForDevServer.options.devServer ??= {};
443
+ if (compilerForDevServer.options.experiments.lazyCompilation) {
444
+ const options = compilerForDevServer.options.experiments.lazyCompilation;
445
+ const setupMiddlewares = result.setupMiddlewares;
446
+ const lazyCompileMiddleware = core_.rspack.experiments.lazyCompilationMiddleware(compilerForDevServer, options);
447
+ result.setupMiddlewares = (middlewares, server)=>{
448
+ let finalMiddlewares = middlewares;
449
+ if (setupMiddlewares) finalMiddlewares = setupMiddlewares(finalMiddlewares, server);
450
+ return [
451
+ lazyCompileMiddleware,
452
+ ...finalMiddlewares
453
+ ];
454
+ };
455
+ }
443
456
  result.hot = options.hot ?? result.hot ?? true;
444
457
  result.host = options.host || result.host;
445
458
  result.port = options.port || result.port;
package/dist/index.mjs CHANGED
@@ -420,6 +420,19 @@ class ServeCommand {
420
420
  }
421
421
  }
422
422
  const result = compilerForDevServer.options.devServer ??= {};
423
+ if (compilerForDevServer.options.experiments.lazyCompilation) {
424
+ const options = compilerForDevServer.options.experiments.lazyCompilation;
425
+ const setupMiddlewares = result.setupMiddlewares;
426
+ const lazyCompileMiddleware = core_.rspack.experiments.lazyCompilationMiddleware(compilerForDevServer, options);
427
+ result.setupMiddlewares = (middlewares, server)=>{
428
+ let finalMiddlewares = middlewares;
429
+ if (setupMiddlewares) finalMiddlewares = setupMiddlewares(finalMiddlewares, server);
430
+ return [
431
+ lazyCompileMiddleware,
432
+ ...finalMiddlewares
433
+ ];
434
+ };
435
+ }
423
436
  result.hot = options.hot ?? result.hot ?? true;
424
437
  result.host = options.host || result.host;
425
438
  result.port = options.port || result.port;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "1.3.0-beta.0",
3
+ "version": "1.3.0-beta.1",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.dev",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -48,8 +48,8 @@
48
48
  "execa": "^5.1.1",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.7.3",
51
- "@rspack/core": "1.3.0-beta.0",
52
- "@rspack/tracing": "1.3.0-beta.0"
51
+ "@rspack/tracing": "1.3.0-beta.1",
52
+ "@rspack/core": "1.3.0-beta.1"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@rspack/core": "^1.0.0-alpha || ^1.x",