react-cosmos-plugin-rspack 2.0.2 → 3.0.0

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.
@@ -183,7 +183,6 @@ function getDefaultRspackConfig(rootDir) {
183
183
  builtAt: true
184
184
  },
185
185
  infrastructureLogging: { level: "warn" },
186
- experiments: { topLevelAwait: true },
187
186
  mode: getRspackNodeEnv(),
188
187
  optimization: { minimize: false }
189
188
  };
@@ -360,13 +359,6 @@ function isIndexHtmlWebpackPlugin(htmlPlugin) {
360
359
  return filename === "index.html" || typeof filename !== "string" || filename.endsWith("/index.html");
361
360
  }
362
361
  //#endregion
363
- //#region src/server/rspackConfig/rspackConfigTopLevelAwait.ts
364
- function ensureRspackConfigTopLevelAwait(baseWebpackConfig) {
365
- const experiments = baseWebpackConfig.experiments || {};
366
- if (!experiments.topLevelAwait) experiments.topLevelAwait = true;
367
- return experiments;
368
- }
369
- //#endregion
370
362
  //#region src/server/rspackConfig/getDevRspackConfig.ts
371
363
  async function getDevRspackConfig(config, userRspack) {
372
364
  const baseRspackConfig = await getUserRspackConfig(config);
@@ -376,8 +368,7 @@ async function getDevRspackConfig(config, userRspack) {
376
368
  output: getOutput$1(config),
377
369
  module: getRspackConfigModule(config, baseRspackConfig, "dev"),
378
370
  resolve: getRspackConfigResolve(config, baseRspackConfig),
379
- plugins: getPlugins$1(config, baseRspackConfig, userRspack),
380
- experiments: getExperiments$1(baseRspackConfig)
371
+ plugins: getPlugins$1(config, baseRspackConfig, userRspack)
381
372
  };
382
373
  if (rspackConfig.optimization?.splitChunks) {
383
374
  const { name } = rspackConfig.optimization.splitChunks;
@@ -421,9 +412,6 @@ function getPlugins$1(config, baseRspackConfig, userRspack) {
421
412
  function getHotMiddlewareEntry(reloadOnFail) {
422
413
  return `${resolve("webpack-hot-middleware/client")}?reload=${reloadOnFail}&overlay=false`;
423
414
  }
424
- function getExperiments$1(baseWebpackConfig) {
425
- return ensureRspackConfigTopLevelAwait(baseWebpackConfig);
426
- }
427
415
  //#endregion
428
416
  //#region src/server/rspackDevServerPlugin.ts
429
417
  async function rspackDevServerPlugin({ config, platform, app, sendMessage }) {
@@ -479,8 +467,7 @@ async function getExportRspackConfig(config, userRspack) {
479
467
  output: getOutput(config),
480
468
  module: getRspackConfigModule(config, baseRspackConfig, "export"),
481
469
  resolve: getRspackConfigResolve(config, baseRspackConfig),
482
- plugins: getPlugins(config, baseRspackConfig, userRspack),
483
- experiments: getExperiments(baseRspackConfig)
470
+ plugins: getPlugins(config, baseRspackConfig, userRspack)
484
471
  };
485
472
  }
486
473
  function getEntry() {
@@ -505,9 +492,6 @@ function getPlugins(config, baseRspackConfig, userRspack) {
505
492
  noEmitErrorsPlugin
506
493
  ]);
507
494
  }
508
- function getExperiments(baseWebpackConfig) {
509
- return ensureRspackConfigTopLevelAwait(baseWebpackConfig);
510
- }
511
495
  //#endregion
512
496
  //#region src/server/rspackExportPlugin.ts
513
497
  async function rspackExportPlugin({ config }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cosmos-plugin-rspack",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "rspack plugin for React Cosmos",
5
5
  "repository": "https://github.com/birchill/react-cosmos-plugin-rspack/",
6
6
  "author": "Birchill, Inc.",
@@ -19,8 +19,8 @@
19
19
  "devDependencies": {
20
20
  "@release-it/conventional-changelog": "10.0.5",
21
21
  "@rollup/plugin-virtual": "3.0.2",
22
- "@rspack/core": "1.7.7",
23
- "@types/node": "22.15.30",
22
+ "@rspack/core": "2.0.2",
23
+ "@types/node": "24.12.2",
24
24
  "@types/webpack-hot-middleware": "2.25.12",
25
25
  "husky": "9.1.7",
26
26
  "knip": "5.86.0",
@@ -41,6 +41,9 @@
41
41
  "publishConfig": {
42
42
  "registry": "https://registry.npmjs.org"
43
43
  },
44
+ "engines": {
45
+ "pnpm": ">=11"
46
+ },
44
47
  "scripts": {
45
48
  "prepublishOnly": "pnpm build",
46
49
  "build": "tsdown && cp src/server/rspackConfig/userImportsLoader.cjs dist/server",
@@ -48,7 +51,7 @@
48
51
  "prepare": "husky"
49
52
  },
50
53
  "peerDependencies": {
51
- "@rspack/core": ">=1.0.0",
54
+ "@rspack/core": ">=2.0.0",
52
55
  "react-cosmos": "^7.1.0"
53
56
  },
54
57
  "lint-staged": {