@rsbuild/webpack 1.0.1-beta.5 → 1.0.1-beta.7

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
@@ -104,10 +104,7 @@ async function inspectConfig({
104
104
  inspectOptions,
105
105
  pluginManager
106
106
  });
107
- let outputPath = inspectOptions.outputPath ? (0, import_node_path.join)(context.distPath, inspectOptions.outputPath) : context.distPath;
108
- if (!(0, import_node_path.isAbsolute)(outputPath)) {
109
- outputPath = (0, import_node_path.join)(context.rootPath, outputPath);
110
- }
107
+ const outputPath = getInspectOutputPath(context, inspectOptions);
111
108
  if (inspectOptions.writeToDisk) {
112
109
  await outputInspectConfigFiles({
113
110
  rawBundlerConfigs,
@@ -130,13 +127,22 @@ async function inspectConfig({
130
127
  }
131
128
  };
132
129
  }
133
- var import_node_path;
130
+ var import_node_path, getInspectOutputPath;
134
131
  var init_inspectConfig = __esm({
135
132
  "src/inspectConfig.ts"() {
136
133
  "use strict";
137
134
  import_node_path = require("path");
138
135
  init_initConfigs();
139
136
  init_shared();
137
+ getInspectOutputPath = (context, inspectOptions) => {
138
+ if (inspectOptions.outputPath) {
139
+ if ((0, import_node_path.isAbsolute)(inspectOptions.outputPath)) {
140
+ return inspectOptions.outputPath;
141
+ }
142
+ return (0, import_node_path.join)(context.distPath, inspectOptions.outputPath);
143
+ }
144
+ return context.distPath;
145
+ };
140
146
  }
141
147
  });
142
148
 
@@ -2454,13 +2460,15 @@ var init_build = __esm({
2454
2460
  let isFirstCompile = true;
2455
2461
  await context.hooks.onBeforeBuild.call({
2456
2462
  bundlerConfigs,
2457
- environments: context.environments
2463
+ environments: context.environments,
2464
+ isWatch: Boolean(watch)
2458
2465
  });
2459
2466
  const onDone = async (stats) => {
2460
2467
  const p = context.hooks.onAfterBuild.call({
2461
2468
  isFirstCompile,
2462
2469
  stats,
2463
- environments: context.environments
2470
+ environments: context.environments,
2471
+ isWatch: Boolean(watch)
2464
2472
  });
2465
2473
  isFirstCompile = false;
2466
2474
  await p;
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.56.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
49
+ // ../../../node_modules/.pnpm/@modern-js+module-tools@2.56.2_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.56.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
53
+ "../../../node_modules/.pnpm/@modern-js+module-tools@2.56.2_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js"() {
54
54
  "use strict";
55
55
  }
56
56
  });
@@ -123,10 +123,7 @@ async function inspectConfig({
123
123
  inspectOptions,
124
124
  pluginManager
125
125
  });
126
- let outputPath = inspectOptions.outputPath ? join(context.distPath, inspectOptions.outputPath) : context.distPath;
127
- if (!isAbsolute(outputPath)) {
128
- outputPath = join(context.rootPath, outputPath);
129
- }
126
+ const outputPath = getInspectOutputPath(context, inspectOptions);
130
127
  if (inspectOptions.writeToDisk) {
131
128
  await outputInspectConfigFiles({
132
129
  rawBundlerConfigs,
@@ -149,12 +146,22 @@ async function inspectConfig({
149
146
  }
150
147
  };
151
148
  }
149
+ var getInspectOutputPath;
152
150
  var init_inspectConfig = __esm({
153
151
  "src/inspectConfig.ts"() {
154
152
  "use strict";
155
153
  init_esm();
156
154
  init_initConfigs();
157
155
  init_shared();
156
+ getInspectOutputPath = (context, inspectOptions) => {
157
+ if (inspectOptions.outputPath) {
158
+ if (isAbsolute(inspectOptions.outputPath)) {
159
+ return inspectOptions.outputPath;
160
+ }
161
+ return join(context.distPath, inspectOptions.outputPath);
162
+ }
163
+ return context.distPath;
164
+ };
158
165
  }
159
166
  });
160
167
 
@@ -2502,13 +2509,15 @@ var init_build = __esm({
2502
2509
  let isFirstCompile = true;
2503
2510
  await context.hooks.onBeforeBuild.call({
2504
2511
  bundlerConfigs,
2505
- environments: context.environments
2512
+ environments: context.environments,
2513
+ isWatch: Boolean(watch)
2506
2514
  });
2507
2515
  const onDone = async (stats) => {
2508
2516
  const p = context.hooks.onAfterBuild.call({
2509
2517
  isFirstCompile,
2510
2518
  stats,
2511
- environments: context.environments
2519
+ environments: context.environments,
2520
+ isWatch: Boolean(watch)
2512
2521
  });
2513
2522
  isFirstCompile = false;
2514
2523
  await p;
@@ -1,10 +1,10 @@
1
- import { type CreateRsbuildOptions, type PluginManager } from '@rsbuild/core';
1
+ import { type PluginManager, type ResolvedCreateRsbuildOptions } from '@rsbuild/core';
2
2
  import { type InternalContext } from './shared';
3
3
  import type { WebpackConfig } from './types';
4
4
  export type InitConfigsOptions = {
5
5
  context: InternalContext;
6
6
  pluginManager: PluginManager;
7
- rsbuildOptions: Required<CreateRsbuildOptions>;
7
+ rsbuildOptions: ResolvedCreateRsbuildOptions;
8
8
  };
9
9
  export declare function initConfigs({ context, pluginManager, rsbuildOptions, }: InitConfigsOptions): Promise<{
10
10
  webpackConfigs: WebpackConfig[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.0.1-beta.5",
3
+ "version": "1.0.1-beta.7",
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.5"
33
+ "@rsbuild/core": "1.0.1-beta.7"
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.5"
41
+ "@scripts/test-helper": "1.0.1-beta.7"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",