@rsbuild/webpack 1.0.1-rc.0 → 1.0.1-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/index.cjs CHANGED
@@ -2458,21 +2458,27 @@ var init_build = __esm({
2458
2458
  })
2459
2459
  };
2460
2460
  }
2461
- await new Promise(
2462
- (resolve, reject) => {
2463
- compiler.run((err, stats) => {
2464
- if (err || stats?.hasErrors()) {
2465
- const buildError = err || new Error("Webpack build failed!");
2466
- reject(buildError);
2467
- } else {
2468
- compiler.close((closeErr) => {
2469
- closeErr && import_core7.logger.error(closeErr);
2470
- resolve({ stats });
2471
- });
2472
- }
2473
- });
2461
+ const { stats } = await new Promise((resolve, reject) => {
2462
+ compiler.run((err, stats2) => {
2463
+ if (err) {
2464
+ reject(err);
2465
+ } else if (stats2?.hasErrors()) {
2466
+ reject(new Error("Rspack build failed!"));
2467
+ } else {
2468
+ compiler.close((closeErr) => {
2469
+ closeErr && import_core7.logger.error(closeErr);
2470
+ resolve({ stats: stats2 });
2471
+ });
2472
+ }
2473
+ });
2474
+ });
2475
+ return {
2476
+ stats,
2477
+ // This close method is a noop in non-watch mode
2478
+ // In watch mode, it's defined above to stop watching
2479
+ close: async () => {
2474
2480
  }
2475
- );
2481
+ };
2476
2482
  };
2477
2483
  }
2478
2484
  });
package/dist/index.js CHANGED
@@ -46,11 +46,11 @@ var __publicField = (obj, key, value) => {
46
46
  return value;
47
47
  };
48
48
 
49
- // ../../../node_modules/.pnpm/@modern-js+module-tools@2.58.2_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
50
- import { fileURLToPath } from "url";
49
+ // ../../../node_modules/.pnpm/@modern-js+module-tools@2.58.3_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
51
50
  import path from "path";
51
+ import { fileURLToPath } from "url";
52
52
  var init_esm = __esm({
53
- "../../../node_modules/.pnpm/@modern-js+module-tools@2.58.2_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
53
+ "../../../node_modules/.pnpm/@modern-js+module-tools@2.58.3_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
54
54
  "use strict";
55
55
  }
56
56
  });
@@ -2507,21 +2507,27 @@ var init_build = __esm({
2507
2507
  })
2508
2508
  };
2509
2509
  }
2510
- await new Promise(
2511
- (resolve, reject) => {
2512
- compiler.run((err, stats) => {
2513
- if (err || stats?.hasErrors()) {
2514
- const buildError = err || new Error("Webpack build failed!");
2515
- reject(buildError);
2516
- } else {
2517
- compiler.close((closeErr) => {
2518
- closeErr && logger6.error(closeErr);
2519
- resolve({ stats });
2520
- });
2521
- }
2522
- });
2510
+ const { stats } = await new Promise((resolve, reject) => {
2511
+ compiler.run((err, stats2) => {
2512
+ if (err) {
2513
+ reject(err);
2514
+ } else if (stats2?.hasErrors()) {
2515
+ reject(new Error("Rspack build failed!"));
2516
+ } else {
2517
+ compiler.close((closeErr) => {
2518
+ closeErr && logger6.error(closeErr);
2519
+ resolve({ stats: stats2 });
2520
+ });
2521
+ }
2522
+ });
2523
+ });
2524
+ return {
2525
+ stats,
2526
+ // This close method is a noop in non-watch mode
2527
+ // In watch mode, it's defined above to stop watching
2528
+ close: async () => {
2523
2529
  }
2524
- );
2530
+ };
2525
2531
  };
2526
2532
  }
2527
2533
  });
@@ -1,5 +1,3 @@
1
- import type { BuildOptions } from '@rsbuild/core';
1
+ import type { Build, BuildOptions } from '@rsbuild/core';
2
2
  import type { InitConfigsOptions } from './initConfigs';
3
- export declare const build: (initOptions: InitConfigsOptions, { watch, compiler: customCompiler }?: BuildOptions) => Promise<void | {
4
- close: () => Promise<void>;
5
- }>;
3
+ export declare const build: (initOptions: InitConfigsOptions, { watch, compiler: customCompiler }?: BuildOptions) => Promise<ReturnType<Build>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.0.1-rc.0",
3
+ "version": "1.0.1-rc.1",
4
4
  "homepage": "https://rsbuild.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "reduce-configs": "^1.0.0",
31
31
  "tsconfig-paths-webpack-plugin": "4.1.0",
32
32
  "webpack": "^5.94.0",
33
- "@rsbuild/core": "1.0.1-rc.0"
33
+ "@rsbuild/core": "1.0.1-rc.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "18.x",
@@ -38,7 +38,7 @@
38
38
  "cli-truncate": "2.1.0",
39
39
  "patch-console": "1.0.0",
40
40
  "typescript": "^5.5.2",
41
- "@scripts/test-helper": "1.0.1-rc.0"
41
+ "@scripts/test-helper": "1.0.1-rc.1"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",