@rsbuild/webpack 0.2.7 → 0.2.9
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/core/build.d.ts +10 -14
- package/dist/core/createCompiler.d.ts +6 -9
- package/dist/core/devMiddleware.d.ts +1 -1
- package/dist/core/initConfigs.d.ts +6 -10
- package/dist/core/inspectConfig.d.ts +4 -10
- package/dist/core/webpackConfig.d.ts +4 -7
- package/dist/core/webpackConfig.js +2 -1
- package/dist/exports/webpack.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/plugins/copy.d.ts +1 -1
- package/dist/plugins/css.d.ts +7 -19
- package/dist/plugins/hmr.d.ts +1 -1
- package/dist/plugins/less.d.ts +2 -2
- package/dist/plugins/minimize.d.ts +1 -1
- package/dist/plugins/output.d.ts +1 -1
- package/dist/plugins/progress.d.ts +1 -1
- package/dist/plugins/resolve.d.ts +1 -1
- package/dist/plugins/sass.d.ts +1 -1
- package/dist/plugins/server.d.ts +1 -1
- package/dist/progress/ProgressPlugin.d.ts +8 -8
- package/dist/progress/helpers/bar.d.ts +1 -1
- package/dist/progress/helpers/bus.d.ts +12 -12
- package/dist/progress/helpers/index.d.ts +1 -1
- package/dist/progress/helpers/log.d.ts +4 -4
- package/dist/progress/helpers/nonTty.d.ts +8 -14
- package/dist/progress/helpers/percentage.d.ts +1 -1
- package/dist/progress/helpers/type.d.ts +19 -19
- package/dist/progress/helpers/utils.d.ts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +5 -5
package/dist/core/build.d.ts
CHANGED
|
@@ -2,19 +2,15 @@ import { InitConfigsOptions } from './initConfigs';
|
|
|
2
2
|
import { type Stats, type BuildOptions } from '@rsbuild/shared';
|
|
3
3
|
import type { Compiler, MultiStats, MultiCompiler } from 'webpack';
|
|
4
4
|
export interface BuildExecuter {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
(compiler: Compiler): Promise<{
|
|
6
|
+
stats: Stats;
|
|
7
|
+
}>;
|
|
8
|
+
(compiler: MultiCompiler): Promise<{
|
|
9
|
+
stats: MultiStats;
|
|
10
|
+
}>;
|
|
11
|
+
(compiler: Compiler | MultiCompiler): Promise<{
|
|
12
|
+
stats: Stats | MultiStats;
|
|
13
|
+
}>;
|
|
14
14
|
}
|
|
15
15
|
export declare const webpackBuild: BuildExecuter;
|
|
16
|
-
export declare const build: (initOptions: InitConfigsOptions, {
|
|
17
|
-
mode,
|
|
18
|
-
watch,
|
|
19
|
-
compiler: customCompiler
|
|
20
|
-
}?: BuildOptions, executer?: BuildExecuter) => Promise<void>;
|
|
16
|
+
export declare const build: (initOptions: InitConfigsOptions, { mode, watch, compiler: customCompiler }?: BuildOptions, executer?: BuildExecuter) => Promise<void>;
|
|
@@ -2,14 +2,11 @@ import { type Rspack } from '@rsbuild/shared';
|
|
|
2
2
|
import type { Context } from '@rsbuild/core/provider';
|
|
3
3
|
import type { WebpackConfig } from '../types';
|
|
4
4
|
import { InitConfigsOptions } from './initConfigs';
|
|
5
|
-
export declare function createCompiler({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}: {
|
|
9
|
-
context: Context;
|
|
10
|
-
webpackConfigs: WebpackConfig[];
|
|
5
|
+
export declare function createCompiler({ context, webpackConfigs, }: {
|
|
6
|
+
context: Context;
|
|
7
|
+
webpackConfigs: WebpackConfig[];
|
|
11
8
|
}): Promise<Rspack.Compiler | Rspack.MultiCompiler>;
|
|
12
9
|
export declare function createDevMiddleware(options: InitConfigsOptions, customCompiler?: Rspack.Compiler | Rspack.MultiCompiler): Promise<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>;
|
|
10
|
+
devMiddleware: import("@rsbuild/shared").DevMiddleware;
|
|
11
|
+
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
12
|
+
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Compiler, MultiCompiler } from 'webpack';
|
|
2
2
|
import { DevMiddleware } from '@rsbuild/shared';
|
|
3
|
-
export declare const getDevMiddleware: (compiler: Compiler | MultiCompiler) => NonNullable<DevMiddleware>;
|
|
3
|
+
export declare const getDevMiddleware: (compiler: Compiler | MultiCompiler) => NonNullable<DevMiddleware>;
|
|
@@ -2,14 +2,10 @@ import { type PluginStore, type CreateRsbuildOptions } from '@rsbuild/shared';
|
|
|
2
2
|
import { type Context } from '@rsbuild/core/provider';
|
|
3
3
|
import type { WebpackConfig } from '../types';
|
|
4
4
|
export type InitConfigsOptions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
context: Context;
|
|
6
|
+
pluginStore: PluginStore;
|
|
7
|
+
rsbuildOptions: Required<CreateRsbuildOptions>;
|
|
8
8
|
};
|
|
9
|
-
export declare function initConfigs({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
rsbuildOptions
|
|
13
|
-
}: InitConfigsOptions): Promise<{
|
|
14
|
-
webpackConfigs: WebpackConfig[];
|
|
15
|
-
}>;
|
|
9
|
+
export declare function initConfigs({ context, pluginStore, rsbuildOptions, }: InitConfigsOptions): Promise<{
|
|
10
|
+
webpackConfigs: WebpackConfig[];
|
|
11
|
+
}>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { InitConfigsOptions } from './initConfigs';
|
|
2
2
|
import { type InspectConfigResult, type InspectConfigOptions } from '@rsbuild/shared';
|
|
3
3
|
import type { WebpackConfig } from '../types';
|
|
4
|
-
export declare function inspectConfig({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
bundlerConfigs,
|
|
9
|
-
inspectOptions
|
|
10
|
-
}: InitConfigsOptions & {
|
|
11
|
-
inspectOptions?: InspectConfigOptions;
|
|
12
|
-
bundlerConfigs?: WebpackConfig[];
|
|
13
|
-
}): Promise<InspectConfigResult<'webpack'>>;
|
|
4
|
+
export declare function inspectConfig({ context, pluginStore, rsbuildOptions, bundlerConfigs, inspectOptions, }: InitConfigsOptions & {
|
|
5
|
+
inspectOptions?: InspectConfigOptions;
|
|
6
|
+
bundlerConfigs?: WebpackConfig[];
|
|
7
|
+
}): Promise<InspectConfigResult<'webpack'>>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type RsbuildTarget } from '@rsbuild/shared';
|
|
2
2
|
import type { Context } from '@rsbuild/core/provider';
|
|
3
3
|
import type { WebpackConfig } from '../types';
|
|
4
|
-
export declare function generateWebpackConfig({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}:
|
|
8
|
-
target: RsbuildTarget;
|
|
9
|
-
context: Context;
|
|
10
|
-
}): Promise<WebpackConfig>;
|
|
4
|
+
export declare function generateWebpackConfig({ target, context, }: {
|
|
5
|
+
target: RsbuildTarget;
|
|
6
|
+
context: Context;
|
|
7
|
+
}): Promise<WebpackConfig>;
|
|
@@ -67,7 +67,8 @@ async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
|
67
67
|
}
|
|
68
68
|
async function getChainUtils(target) {
|
|
69
69
|
const { default: webpack } = await Promise.resolve().then(() => __toESM(require("webpack")));
|
|
70
|
-
const {
|
|
70
|
+
const { getHTMLPlugin } = await Promise.resolve().then(() => __toESM(require("@rsbuild/core/provider")));
|
|
71
|
+
const HtmlPlugin = getHTMLPlugin();
|
|
71
72
|
const nodeEnv = process.env.NODE_ENV;
|
|
72
73
|
const nameMap = {
|
|
73
74
|
web: "client",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import webpack from 'webpack';
|
|
2
|
-
export default webpack;
|
|
2
|
+
export default webpack;
|
package/dist/index.d.ts
CHANGED
package/dist/plugins/copy.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginCopy: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginCopy: () => RsbuildPlugin;
|
package/dist/plugins/css.d.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { ModifyChainUtils, type Context, type RsbuildPlugin, type NormalizedConfig, type BundlerChainRule } from '@rsbuild/shared';
|
|
2
|
-
export declare function applyBaseCSSRule({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
isProd,
|
|
9
|
-
isServer,
|
|
10
|
-
CHAIN_ID,
|
|
11
|
-
isWebWorker
|
|
12
|
-
},
|
|
13
|
-
importLoaders
|
|
14
|
-
}: {
|
|
15
|
-
rule: BundlerChainRule;
|
|
16
|
-
config: NormalizedConfig;
|
|
17
|
-
context: Context;
|
|
18
|
-
utils: ModifyChainUtils;
|
|
19
|
-
importLoaders?: number;
|
|
2
|
+
export declare function applyBaseCSSRule({ rule, config, context, utils: { target, isProd, isServer, CHAIN_ID, isWebWorker }, importLoaders, }: {
|
|
3
|
+
rule: BundlerChainRule;
|
|
4
|
+
config: NormalizedConfig;
|
|
5
|
+
context: Context;
|
|
6
|
+
utils: ModifyChainUtils;
|
|
7
|
+
importLoaders?: number;
|
|
20
8
|
}): Promise<void>;
|
|
21
|
-
export declare const pluginCss: () => RsbuildPlugin;
|
|
9
|
+
export declare const pluginCss: () => RsbuildPlugin;
|
package/dist/plugins/hmr.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginHMR: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginHMR: () => RsbuildPlugin;
|
package/dist/plugins/less.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileFilterUtil, type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
2
|
export type LessLoaderUtils = {
|
|
3
|
-
|
|
3
|
+
addExcludes: FileFilterUtil;
|
|
4
4
|
};
|
|
5
|
-
export declare function pluginLess(): RsbuildPlugin;
|
|
5
|
+
export declare function pluginLess(): RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginMinimize: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginMinimize: () => RsbuildPlugin;
|
package/dist/plugins/output.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginOutput: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginOutput: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginProgress: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginProgress: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginResolve: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginResolve: () => RsbuildPlugin;
|
package/dist/plugins/sass.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare function pluginSass(): RsbuildPlugin;
|
|
2
|
+
export declare function pluginSass(): RsbuildPlugin;
|
package/dist/plugins/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
|
-
export declare const pluginServer: () => RsbuildPlugin;
|
|
2
|
+
export declare const pluginServer: () => RsbuildPlugin;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import webpack from 'webpack';
|
|
2
2
|
import type { Props } from './helpers/type';
|
|
3
3
|
export interface ProgressOptions extends Omit<Partial<Props>, 'message' | 'total' | 'current' | 'done'> {
|
|
4
|
-
|
|
4
|
+
id?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class ProgressPlugin extends webpack.ProgressPlugin {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
7
|
+
readonly name: string;
|
|
8
|
+
id: string;
|
|
9
|
+
hasCompileErrors: boolean;
|
|
10
|
+
compileTime: string | null;
|
|
11
|
+
constructor(options: ProgressOptions);
|
|
12
|
+
apply(compiler: webpack.Compiler): void;
|
|
13
|
+
}
|
|
@@ -2,4 +2,4 @@ import type { Props } from './type';
|
|
|
2
2
|
export declare const FULL_WIDTH = 70;
|
|
3
3
|
export declare const MIDDLE_WIDTH = 40;
|
|
4
4
|
export declare const SMALL_WIDTH = 15;
|
|
5
|
-
export declare const renderBar: (option: Partial<Props>) => string;
|
|
5
|
+
export declare const renderBar: (option: Partial<Props>) => string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Props } from './type';
|
|
2
2
|
import type { LogUpdate } from './log';
|
|
3
3
|
declare class Bus {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
states: Partial<Props>[];
|
|
5
|
+
log: LogUpdate;
|
|
6
|
+
restore: () => void;
|
|
7
|
+
prevOutput: string;
|
|
8
|
+
destroyed: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
update(state: Partial<Props>): void;
|
|
11
|
+
writeToStd(type?: 'stdout' | 'stderr', data?: string): void;
|
|
12
|
+
render(): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
clear(): void;
|
|
15
15
|
}
|
|
16
16
|
declare const bus: Bus;
|
|
17
|
-
export { bus };
|
|
17
|
+
export { bus };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Writable } from 'stream';
|
|
3
3
|
export interface LogUpdate {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
clear: () => void;
|
|
5
|
+
done: () => void;
|
|
6
|
+
(str: string): void;
|
|
7
7
|
}
|
|
8
8
|
declare const create: (stream: Writable) => LogUpdate;
|
|
9
|
-
export { create };
|
|
9
|
+
export { create };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
export declare function createNonTTYLogger(): {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
done: boolean;
|
|
11
|
-
current: number;
|
|
12
|
-
hasErrors: boolean;
|
|
13
|
-
compileTime: string | null;
|
|
14
|
-
}) => void;
|
|
15
|
-
};
|
|
2
|
+
log: ({ id, done, current, hasErrors, compileTime, }: {
|
|
3
|
+
id: string;
|
|
4
|
+
done: boolean;
|
|
5
|
+
current: number;
|
|
6
|
+
hasErrors: boolean;
|
|
7
|
+
compileTime: string | null;
|
|
8
|
+
}) => void;
|
|
9
|
+
};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* or decrease in some cases, which will confuse the user.
|
|
5
5
|
* So we format the percentage number and display a more smooth percentage.
|
|
6
6
|
*/
|
|
7
|
-
export declare const createFriendlyPercentage: () => (percentage: number) => number;
|
|
7
|
+
export declare const createFriendlyPercentage: () => (percentage: number) => number;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { Colors } from '@rsbuild/shared';
|
|
2
2
|
export type Props = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
total: number;
|
|
4
|
+
current: number;
|
|
5
|
+
color: Colors;
|
|
6
|
+
bgColor: Colors;
|
|
7
|
+
char: string;
|
|
8
|
+
width: number;
|
|
9
|
+
buildIcon: string;
|
|
10
|
+
errorIcon: string;
|
|
11
|
+
errorInfo: string;
|
|
12
|
+
message: string;
|
|
13
|
+
done: boolean;
|
|
14
|
+
messageWidth: number;
|
|
15
|
+
spaceWidth: number;
|
|
16
|
+
messageColor: Colors;
|
|
17
|
+
id: string;
|
|
18
|
+
maxIdLen: number;
|
|
19
|
+
hasErrors: boolean;
|
|
20
20
|
};
|
|
21
21
|
export type BusOption = {
|
|
22
|
-
|
|
23
|
-
};
|
|
22
|
+
state: Props[];
|
|
23
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const clamp: (x: number, min: number, max: number) => number;
|
|
1
|
+
export declare const clamp: (x: number, min: number, max: number) => number;
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type RsbuildProvider } from '@rsbuild/shared';
|
|
2
|
-
export declare const webpackProvider: RsbuildProvider<'webpack'>;
|
|
2
|
+
export declare const webpackProvider: RsbuildProvider<'webpack'>;
|
package/dist/shared.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Plugins, type RsbuildPlugin } from '@rsbuild/shared';
|
|
2
2
|
export declare const applyDefaultPlugins: (plugins: Plugins) => import("@rsbuild/shared").AwaitableGetter<RsbuildPlugin>;
|
|
3
|
-
export declare const getCompiledPath: (packageName: string) => string;
|
|
3
|
+
export declare const getCompiledPath: (packageName: string) => string;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"fast-glob": "^3.3.1",
|
|
31
31
|
"globby": "^11.1.0",
|
|
32
|
-
"html-webpack-plugin": "npm:html-rspack-plugin@5.
|
|
32
|
+
"html-webpack-plugin": "npm:html-rspack-plugin@5.6.0",
|
|
33
33
|
"mini-css-extract-plugin": "2.7.6",
|
|
34
34
|
"postcss": "8.4.31",
|
|
35
35
|
"style-loader": "3.3.3",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
38
38
|
"webpack": "^5.89.0",
|
|
39
39
|
"webpack-chain": "^6.5.1",
|
|
40
|
-
"@rsbuild/
|
|
41
|
-
"@rsbuild/
|
|
40
|
+
"@rsbuild/shared": "0.2.9",
|
|
41
|
+
"@rsbuild/core": "0.2.9"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "16.x",
|
|
45
45
|
"typescript": "^5.3.0",
|
|
46
|
-
"@rsbuild/test-helper": "0.2.
|
|
46
|
+
"@rsbuild/test-helper": "0.2.9"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public",
|