@rsbuild/webpack 1.1.0 → 1.1.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.
@@ -1,11 +1,11 @@
1
- import { type PluginManager, type ResolvedCreateRsbuildOptions } from '@rsbuild/core';
2
- import { type InternalContext } from './shared.js';
1
+ import { type InternalContext, type PluginManager, type ResolvedCreateRsbuildOptions, type RsbuildProviderHelpers } from '@rsbuild/core';
3
2
  import type { WebpackConfig } from './types.js';
4
3
  export type InitConfigsOptions = {
5
4
  context: InternalContext;
6
5
  pluginManager: PluginManager;
7
6
  rsbuildOptions: ResolvedCreateRsbuildOptions;
7
+ helpers: RsbuildProviderHelpers;
8
8
  };
9
- export declare function initConfigs({ context, pluginManager, rsbuildOptions, }: InitConfigsOptions): Promise<{
9
+ export declare function initConfigs({ context, pluginManager, rsbuildOptions, helpers, }: InitConfigsOptions): Promise<{
10
10
  webpackConfigs: WebpackConfig[];
11
11
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { InspectConfigOptions, InspectConfigResult } from '@rsbuild/core';
2
2
  import { type InitConfigsOptions } from './initConfigs.js';
3
3
  import type { WebpackConfig } from './types.js';
4
- export declare function inspectConfig({ context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions, }: InitConfigsOptions & {
4
+ export declare function inspectConfig({ helpers, context, pluginManager, rsbuildOptions, bundlerConfigs, inspectOptions, }: InitConfigsOptions & {
5
5
  inspectOptions?: InspectConfigOptions;
6
6
  bundlerConfigs?: WebpackConfig[];
7
7
  }): Promise<InspectConfigResult<'webpack'>>;
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
1
+ import type { RsbuildPlugin, RsbuildProviderHelpers } from '@rsbuild/core';
2
2
  /**
3
3
  * Handling differences between Webpack and Rspack
4
4
  */
5
- export declare const pluginAdaptor: () => RsbuildPlugin;
5
+ export declare const pluginAdaptor: (helpers: RsbuildProviderHelpers) => RsbuildPlugin;
@@ -2,12 +2,14 @@ import webpack from 'webpack';
2
2
  import type { Props } from './helpers/types.js';
3
3
  export interface ProgressOptions extends Omit<Partial<Props>, 'message' | 'total' | 'current' | 'done'> {
4
4
  id?: string;
5
+ prettyTime: (seconds: number) => string;
5
6
  }
6
7
  export declare class ProgressPlugin extends webpack.ProgressPlugin {
7
8
  readonly name: string;
8
9
  id: string;
9
10
  hasCompileErrors: boolean;
10
11
  compileTime: string | null;
12
+ prettyTime: (seconds: number) => string;
11
13
  constructor(options: ProgressOptions);
12
14
  apply(compiler: webpack.Compiler): void;
13
15
  }
package/dist/shared.d.ts CHANGED
@@ -1,28 +1 @@
1
- import { __internalHelper } from '@rsbuild/core';
2
- declare const getChainUtils: typeof __internalHelper.getChainUtils, initRsbuildConfig: typeof __internalHelper.initRsbuildConfig, createDevServer: typeof __internalHelper.createDevServer, formatStats: typeof __internalHelper.formatStats, getStatsOptions: typeof __internalHelper.getStatsOptions, stringifyConfig: typeof __internalHelper.stringifyConfig, outputInspectConfigFiles: typeof __internalHelper.outputInspectConfigFiles, getRsbuildInspectConfig: ({ normalizedConfig, inspectOptions, pluginManager, }: {
3
- normalizedConfig: import("@rsbuild/core").NormalizedConfig;
4
- inspectOptions: import("@rsbuild/core").InspectConfigOptions;
5
- pluginManager: import("@rsbuild/core").PluginManager;
6
- }) => {
7
- rawRsbuildConfig: string;
8
- rsbuildConfig: import("@rsbuild/core").InspectConfigResult["origin"]["rsbuildConfig"];
9
- rawEnvironmentConfigs: Array<{
10
- name: string;
11
- content: string;
12
- }>;
13
- environmentConfigs: import("@rsbuild/core").InspectConfigResult["origin"]["environmentConfigs"];
14
- }, chainToConfig: typeof __internalHelper.chainToConfig, modifyBundlerChain: typeof __internalHelper.modifyBundlerChain, registerDevHook: ({ context, compiler, bundlerConfigs, MultiStatsCtor, }: {
15
- bundlerConfigs?: import("@rspack/core").Configuration[];
16
- context: __internalHelper.InternalContext;
17
- compiler: import("@rspack/core").Compiler | import("@rspack/core").MultiCompiler;
18
- MultiStatsCtor: new (stats: import("@rspack/core").Stats[]) => import("@rspack/core").MultiStats;
19
- }) => void, registerBuildHook: ({ context, isWatch, compiler, bundlerConfigs, MultiStatsCtor, }: {
20
- bundlerConfigs?: import("@rspack/core").Configuration[];
21
- context: __internalHelper.InternalContext;
22
- compiler: import("@rspack/core").Compiler | import("@rspack/core").MultiCompiler;
23
- isWatch: boolean;
24
- MultiStatsCtor: new (stats: import("@rspack/core").Stats[]) => import("@rspack/core").MultiStats;
25
- }) => void, prettyTime: (seconds: number) => string;
26
- export { getChainUtils, initRsbuildConfig, createDevServer, formatStats, getStatsOptions, stringifyConfig, outputInspectConfigFiles, chainToConfig, modifyBundlerChain, registerDevHook, registerBuildHook, prettyTime, getRsbuildInspectConfig, };
27
- export type InternalContext = __internalHelper.InternalContext;
28
1
  export declare const castArray: <T>(arr?: T | T[]) => T[];
@@ -1,8 +1,8 @@
1
- import { type RsbuildTarget } from '@rsbuild/core';
2
- import { type InternalContext } from './shared.js';
1
+ import { type InternalContext, type RsbuildProviderHelpers, type RsbuildTarget } from '@rsbuild/core';
3
2
  import type { WebpackConfig } from './types.js';
4
- export declare function generateWebpackConfig({ target, context, environment, }: {
3
+ export declare function generateWebpackConfig({ target, context, environment, helpers, }: {
5
4
  environment: string;
6
5
  target: RsbuildTarget;
7
6
  context: InternalContext;
7
+ helpers: RsbuildProviderHelpers;
8
8
  }): Promise<WebpackConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "homepage": "https://rsbuild.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,16 +31,17 @@
31
31
  "webpack": "^5.96.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/node": "18.x",
34
+ "@rslib/core": "0.0.18",
35
+ "@types/node": "^22.9.0",
35
36
  "ansi-escapes": "4.3.2",
36
37
  "cli-truncate": "2.1.0",
37
38
  "patch-console": "1.0.0",
38
39
  "typescript": "^5.6.3",
39
- "@rsbuild/core": "1.1.0",
40
+ "@rsbuild/core": "1.1.2",
40
41
  "@scripts/test-helper": "1.0.1"
41
42
  },
42
43
  "peerDependencies": {
43
- "@rsbuild/core": "1.x"
44
+ "@rsbuild/core": "^1.1.2"
44
45
  },
45
46
  "publishConfig": {
46
47
  "access": "public",