@rsbuild/webpack 1.3.1 → 1.3.2

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
@@ -89,41 +89,6 @@ for(var __webpack_i__ in (()=>{
89
89
  var core_ = __webpack_require__("@rsbuild/core");
90
90
  let MultiStats_js_namespaceObject = require("webpack/lib/MultiStats.js");
91
91
  var MultiStats_js_default = __webpack_require__.n(MultiStats_js_namespaceObject);
92
- let external_node_path_namespaceObject = require("node:path"), getInspectOutputPath = (context, inspectOptions)=>inspectOptions.outputPath ? (0, external_node_path_namespaceObject.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, external_node_path_namespaceObject.join)(context.distPath, inspectOptions.outputPath) : (0, external_node_path_namespaceObject.join)(context.distPath, '.rsbuild');
93
- async function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions = {} }) {
94
- inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode : process.env.NODE_ENV || (process.env.NODE_ENV = 'development');
95
- let webpackConfigs = bundlerConfigs || (await initConfigs({
96
- context,
97
- pluginManager,
98
- rsbuildOptions,
99
- helpers
100
- })).webpackConfigs, rawBundlerConfigs = webpackConfigs.map((config, index)=>({
101
- name: config.name || String(index),
102
- content: helpers.stringifyConfig(config, inspectOptions.verbose)
103
- })), { rsbuildConfig, rawRsbuildConfig, environmentConfigs, rawEnvironmentConfigs } = helpers.getRsbuildInspectConfig({
104
- normalizedConfig: context.normalizedConfig,
105
- inspectOptions,
106
- pluginManager
107
- }), outputPath = getInspectOutputPath(context, inspectOptions);
108
- return inspectOptions.writeToDisk && await helpers.outputInspectConfigFiles({
109
- rawBundlerConfigs,
110
- rawEnvironmentConfigs,
111
- inspectOptions: {
112
- ...inspectOptions,
113
- outputPath
114
- },
115
- configType: 'webpack'
116
- }), {
117
- rsbuildConfig: rawRsbuildConfig,
118
- environmentConfigs: rawEnvironmentConfigs.map((r)=>r.content),
119
- bundlerConfigs: rawBundlerConfigs.map((r)=>r.content),
120
- origin: {
121
- rsbuildConfig,
122
- environmentConfigs,
123
- bundlerConfigs: webpackConfigs
124
- }
125
- };
126
- }
127
92
  let external_reduce_configs_namespaceObject = require("reduce-configs"), castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
128
93
  arr
129
94
  ];
@@ -196,16 +161,16 @@ for(var __webpack_i__ in (()=>{
196
161
  })));
197
162
  if ('verbose' === core_.logger.level) {
198
163
  let inspect = async ()=>{
199
- await inspectConfig({
164
+ await helpers.inspectConfig({
200
165
  context,
166
+ bundler: 'webpack',
201
167
  pluginManager,
202
168
  inspectOptions: {
203
169
  verbose: !0,
204
170
  writeToDisk: !0
205
171
  },
206
172
  rsbuildOptions,
207
- bundlerConfigs: webpackConfigs,
208
- helpers
173
+ bundlerConfigs: webpackConfigs
209
174
  });
210
175
  };
211
176
  context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
@@ -401,13 +366,22 @@ for(var __webpack_i__ in (()=>{
401
366
  rsbuildOptions,
402
367
  helpers
403
368
  }, options),
404
- inspectConfig: async (inspectOptions)=>await inspectConfig({
369
+ async inspectConfig (inspectOptions) {
370
+ let bundlerConfigs = (await initConfigs({
405
371
  context,
406
372
  pluginManager,
407
373
  rsbuildOptions,
408
- inspectOptions,
409
374
  helpers
410
- })
375
+ })).webpackConfigs;
376
+ return await helpers.inspectConfig({
377
+ context,
378
+ pluginManager,
379
+ bundler: 'webpack',
380
+ bundlerConfigs,
381
+ rsbuildOptions,
382
+ inspectOptions
383
+ });
384
+ }
411
385
  };
412
386
  };
413
387
  })(), exports.webpackProvider = __webpack_exports__.webpackProvider, __webpack_exports__)-1 === [
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_picocolors__ from "picocolors";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE_webpack__ from "webpack";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE_webpack_lib_MultiStats_js_a72a7b8d__ from "webpack/lib/MultiStats.js";
7
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
8
7
  import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs";
9
8
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
10
9
  var installedChunks, installChunk, __webpack_modules__ = {
@@ -68,41 +67,6 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
68
67
  }
69
68
  };
70
69
  var core_ = __webpack_require__("@rsbuild/core");
71
- let getInspectOutputPath = (context, inspectOptions)=>inspectOptions.outputPath ? (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.isAbsolute)(inspectOptions.outputPath) ? inspectOptions.outputPath : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.distPath, inspectOptions.outputPath) : (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(context.distPath, '.rsbuild');
72
- async function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions = {} }) {
73
- inspectOptions.mode ? process.env.NODE_ENV = inspectOptions.mode : process.env.NODE_ENV || (process.env.NODE_ENV = 'development');
74
- let webpackConfigs = bundlerConfigs || (await initConfigs({
75
- context,
76
- pluginManager,
77
- rsbuildOptions,
78
- helpers
79
- })).webpackConfigs, rawBundlerConfigs = webpackConfigs.map((config, index)=>({
80
- name: config.name || String(index),
81
- content: helpers.stringifyConfig(config, inspectOptions.verbose)
82
- })), { rsbuildConfig, rawRsbuildConfig, environmentConfigs, rawEnvironmentConfigs } = helpers.getRsbuildInspectConfig({
83
- normalizedConfig: context.normalizedConfig,
84
- inspectOptions,
85
- pluginManager
86
- }), outputPath = getInspectOutputPath(context, inspectOptions);
87
- return inspectOptions.writeToDisk && await helpers.outputInspectConfigFiles({
88
- rawBundlerConfigs,
89
- rawEnvironmentConfigs,
90
- inspectOptions: {
91
- ...inspectOptions,
92
- outputPath
93
- },
94
- configType: 'webpack'
95
- }), {
96
- rsbuildConfig: rawRsbuildConfig,
97
- environmentConfigs: rawEnvironmentConfigs.map((r)=>r.content),
98
- bundlerConfigs: rawBundlerConfigs.map((r)=>r.content),
99
- origin: {
100
- rsbuildConfig,
101
- environmentConfigs,
102
- bundlerConfigs: webpackConfigs
103
- }
104
- };
105
- }
106
70
  let castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
107
71
  arr
108
72
  ];
@@ -175,16 +139,16 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
175
139
  })));
176
140
  if ('verbose' === core_.logger.level) {
177
141
  let inspect = async ()=>{
178
- await inspectConfig({
142
+ await helpers.inspectConfig({
179
143
  context,
144
+ bundler: 'webpack',
180
145
  pluginManager,
181
146
  inspectOptions: {
182
147
  verbose: !0,
183
148
  writeToDisk: !0
184
149
  },
185
150
  rsbuildOptions,
186
- bundlerConfigs: webpackConfigs,
187
- helpers
151
+ bundlerConfigs: webpackConfigs
188
152
  });
189
153
  };
190
154
  context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
@@ -377,13 +341,22 @@ let getMainFields = (chain, target)=>{
377
341
  rsbuildOptions,
378
342
  helpers
379
343
  }, options),
380
- inspectConfig: async (inspectOptions)=>await inspectConfig({
344
+ async inspectConfig (inspectOptions) {
345
+ let bundlerConfigs = (await initConfigs({
381
346
  context,
382
347
  pluginManager,
383
348
  rsbuildOptions,
384
- inspectOptions,
385
349
  helpers
386
- })
350
+ })).webpackConfigs;
351
+ return await helpers.inspectConfig({
352
+ context,
353
+ pluginManager,
354
+ bundler: 'webpack',
355
+ bundlerConfigs,
356
+ rsbuildOptions,
357
+ inspectOptions
358
+ });
359
+ }
387
360
  };
388
361
  };
389
362
  export { webpackProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "homepage": "https://rsbuild.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,17 +32,17 @@
32
32
  "webpack": "^5.99.8"
33
33
  },
34
34
  "devDependencies": {
35
- "@rslib/core": "0.7.0",
36
- "@types/node": "^22.15.17",
35
+ "@rslib/core": "0.7.1",
36
+ "@types/node": "^22.15.19",
37
37
  "ansi-escapes": "4.3.2",
38
38
  "cli-truncate": "2.1.0",
39
39
  "patch-console": "1.0.0",
40
40
  "typescript": "^5.8.3",
41
- "@rsbuild/core": "1.3.20",
41
+ "@rsbuild/core": "1.3.21",
42
42
  "@scripts/test-helper": "1.0.1"
43
43
  },
44
44
  "peerDependencies": {
45
- "@rsbuild/core": "^1.1.3"
45
+ "@rsbuild/core": "^1.3.21"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public",
@@ -1,7 +0,0 @@
1
- import type { InspectConfigOptions, InspectConfigResult } from '@rsbuild/core';
2
- import { type InitConfigsOptions } from './initConfigs.js';
3
- import type { WebpackConfig } from './types.js';
4
- export declare function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions, }: InitConfigsOptions & {
5
- inspectOptions?: InspectConfigOptions;
6
- bundlerConfigs?: WebpackConfig[];
7
- }): Promise<InspectConfigResult<'webpack'>>;