@rsbuild/webpack 1.0.1-beta.10 → 1.0.1-beta.12

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
@@ -81,8 +81,8 @@ async function inspectConfig({
81
81
  bundlerConfigs,
82
82
  inspectOptions = {}
83
83
  }) {
84
- if (inspectOptions.env) {
85
- process.env.NODE_ENV = inspectOptions.env;
84
+ if (inspectOptions.mode) {
85
+ process.env.NODE_ENV = inspectOptions.mode;
86
86
  } else if (!process.env.NODE_ENV) {
87
87
  process.env.NODE_ENV = "development";
88
88
  }
@@ -142,7 +142,7 @@ var init_inspectConfig = __esm({
142
142
  }
143
143
  return (0, import_node_path.join)(context.distPath, inspectOptions.outputPath);
144
144
  }
145
- return context.distPath;
145
+ return (0, import_node_path.join)(context.distPath, ".rsbuild");
146
146
  };
147
147
  }
148
148
  });
@@ -330,7 +330,7 @@ async function createCompiler({
330
330
  compiler.hooks.done.tap("rsbuild:done", (stats) => {
331
331
  done(stats);
332
332
  });
333
- if (process.env.NODE_ENV === "development") {
333
+ if (context.normalizedConfig?.mode === "development") {
334
334
  registerDevHook({
335
335
  compiler,
336
336
  context,
@@ -2445,9 +2445,9 @@ var init_build = __esm({
2445
2445
  init_createCompiler();
2446
2446
  init_initConfigs();
2447
2447
  init_shared();
2448
- build = async (initOptions, { mode = "production", watch, compiler: customCompiler } = {}) => {
2448
+ build = async (initOptions, { watch, compiler: customCompiler } = {}) => {
2449
2449
  if (!process.env.NODE_ENV) {
2450
- process.env.NODE_ENV = mode;
2450
+ process.env.NODE_ENV = "production";
2451
2451
  }
2452
2452
  const { context } = initOptions;
2453
2453
  let compiler;
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.57.1_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
49
+ // ../../../node_modules/.pnpm/@modern-js+module-tools@2.58.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
50
50
  import { fileURLToPath } from "url";
51
51
  import path from "path";
52
52
  var init_esm = __esm({
53
- "../../../node_modules/.pnpm/@modern-js+module-tools@2.57.1_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
53
+ "../../../node_modules/.pnpm/@modern-js+module-tools@2.58.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
54
54
  "use strict";
55
55
  }
56
56
  });
@@ -100,8 +100,8 @@ async function inspectConfig({
100
100
  bundlerConfigs,
101
101
  inspectOptions = {}
102
102
  }) {
103
- if (inspectOptions.env) {
104
- process.env.NODE_ENV = inspectOptions.env;
103
+ if (inspectOptions.mode) {
104
+ process.env.NODE_ENV = inspectOptions.mode;
105
105
  } else if (!process.env.NODE_ENV) {
106
106
  process.env.NODE_ENV = "development";
107
107
  }
@@ -161,7 +161,7 @@ var init_inspectConfig = __esm({
161
161
  }
162
162
  return join(context.distPath, inspectOptions.outputPath);
163
163
  }
164
- return context.distPath;
164
+ return join(context.distPath, ".rsbuild");
165
165
  };
166
166
  }
167
167
  });
@@ -356,7 +356,7 @@ async function createCompiler({
356
356
  compiler.hooks.done.tap("rsbuild:done", (stats) => {
357
357
  done(stats);
358
358
  });
359
- if (process.env.NODE_ENV === "development") {
359
+ if (context.normalizedConfig?.mode === "development") {
360
360
  registerDevHook({
361
361
  compiler,
362
362
  context,
@@ -2494,9 +2494,9 @@ var init_build = __esm({
2494
2494
  init_createCompiler();
2495
2495
  init_initConfigs();
2496
2496
  init_shared();
2497
- build = async (initOptions, { mode = "production", watch, compiler: customCompiler } = {}) => {
2497
+ build = async (initOptions, { watch, compiler: customCompiler } = {}) => {
2498
2498
  if (!process.env.NODE_ENV) {
2499
- process.env.NODE_ENV = mode;
2499
+ process.env.NODE_ENV = "production";
2500
2500
  }
2501
2501
  const { context } = initOptions;
2502
2502
  let compiler;
@@ -1,5 +1,5 @@
1
1
  import type { BuildOptions } from '@rsbuild/core';
2
2
  import { type InitConfigsOptions } from './initConfigs';
3
- export declare const build: (initOptions: InitConfigsOptions, { mode, watch, compiler: customCompiler }?: BuildOptions) => Promise<void | {
3
+ export declare const build: (initOptions: InitConfigsOptions, { watch, compiler: customCompiler }?: BuildOptions) => Promise<void | {
4
4
  close: () => Promise<void>;
5
5
  }>;
@@ -12,12 +12,12 @@ declare const getChainUtils: typeof __internalHelper.getChainUtils, initRsbuildC
12
12
  }>;
13
13
  environmentConfigs: import("@rsbuild/core").InspectConfigResult["origin"]["environmentConfigs"];
14
14
  }, chainToConfig: typeof __internalHelper.chainToConfig, modifyBundlerChain: typeof __internalHelper.modifyBundlerChain, registerDevHook: ({ context, compiler, bundlerConfigs, MultiStatsCtor, }: {
15
- bundlerConfigs?: import("node_modules/@rsbuild/core/dist-types/types").RspackConfig[];
15
+ bundlerConfigs?: import("@rspack/core").Configuration[];
16
16
  context: __internalHelper.InternalContext;
17
17
  compiler: import("@rspack/core").Compiler | import("@rspack/core").MultiCompiler;
18
18
  MultiStatsCtor: new (stats: import("@rspack/core").Stats[]) => import("@rspack/core").MultiStats;
19
19
  }) => void, registerBuildHook: ({ context, isWatch, compiler, bundlerConfigs, MultiStatsCtor, }: {
20
- bundlerConfigs?: import("node_modules/@rsbuild/core/dist-types/types").RspackConfig[];
20
+ bundlerConfigs?: import("@rspack/core").Configuration[];
21
21
  context: __internalHelper.InternalContext;
22
22
  compiler: import("@rspack/core").Compiler | import("@rspack/core").MultiCompiler;
23
23
  isWatch: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.0.1-beta.10",
3
+ "version": "1.0.1-beta.12",
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.93.0",
33
- "@rsbuild/core": "1.0.1-beta.10"
33
+ "@rsbuild/core": "1.0.1-beta.12"
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-beta.10"
41
+ "@scripts/test-helper": "1.0.1-beta.12"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",