@rsbuild/core 1.2.16 → 1.2.17
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 +707 -63
- package/dist/index.cjs.LICENSE.txt +20 -0
- package/dist/index.js +691 -54
- package/dist/index.js.LICENSE.txt +20 -0
- package/dist-types/configChain.d.ts +0 -1
- package/dist-types/helpers/path.d.ts +1 -0
- package/dist-types/server/overlay.d.ts +2 -2
- package/dist-types/types/config.d.ts +2 -1
- package/dist-types/types/plugin.d.ts +2 -2
- package/package.json +3 -3
- package/compiled/webpack-merge/index.d.ts +0 -31
- package/compiled/webpack-merge/index.js +0 -1200
- package/compiled/webpack-merge/license +0 -20
- package/compiled/webpack-merge/package.json +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
5
|
+
* Released under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
12
|
+
* Released under the MIT License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*!
|
|
16
|
+
* shallow-clone <https://github.com/jonschlinkert/shallow-clone>
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
19
|
+
* Released under the MIT License.
|
|
20
|
+
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import RspackChain from '../compiled/rspack-chain/index.js';
|
|
2
2
|
import type { InternalContext, ModifyBundlerChainUtils } from './types';
|
|
3
|
-
export declare function getBundlerChain(): RspackChain;
|
|
4
3
|
export declare function modifyBundlerChain(context: InternalContext, utils: ModifyBundlerChainUtils): Promise<RspackChain>;
|
|
5
4
|
export declare const CHAIN_ID: {
|
|
6
5
|
/** Predefined rules */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function getAbsolutePath(base: string, filepath: string): string;
|
|
2
|
+
export declare function getRelativePath(base: string, filepath: string): string;
|
|
2
3
|
export declare function getCommonParentPath(paths: string[]): string;
|
|
3
4
|
export declare const getCompiledPath: (packageName: string) => string;
|
|
4
5
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function convertLinksInHtml(text: string): string;
|
|
2
|
-
export declare function genOverlayHTML(errors: string[]): string;
|
|
1
|
+
export declare function convertLinksInHtml(text: string, root?: string): string;
|
|
2
|
+
export declare function genOverlayHTML(errors: string[], root?: string): string;
|
|
@@ -25,13 +25,14 @@ export type ToolsHtmlPluginConfig = ConfigChainWithContext<HtmlRspackPlugin.Opti
|
|
|
25
25
|
entryName: string;
|
|
26
26
|
entryValue: (string | string[] | Rspack.EntryDescription)[];
|
|
27
27
|
}>;
|
|
28
|
+
export type WebpackMerge = <Configuration extends object>(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration;
|
|
28
29
|
export type ModifyRspackConfigUtils = ModifyChainUtils & {
|
|
29
30
|
addRules: (rules: RspackRule | RspackRule[]) => void;
|
|
30
31
|
appendRules: (rules: RspackRule | RspackRule[]) => void;
|
|
31
32
|
prependPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
32
33
|
appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
33
34
|
removePlugin: (pluginName: string) => void;
|
|
34
|
-
mergeConfig:
|
|
35
|
+
mergeConfig: WebpackMerge;
|
|
35
36
|
rspack: typeof rspack;
|
|
36
37
|
};
|
|
37
38
|
export type ToolsRspackConfig = ConfigChainAsyncWithContext<Rspack.Configuration, ModifyRspackConfigUtils>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RuleSetRule, Configuration as WebpackConfig, WebpackPluginInstance } from 'webpack';
|
|
2
2
|
import type RspackChain from '../../compiled/rspack-chain/index.js';
|
|
3
3
|
import type { ChainIdentifier } from '../configChain';
|
|
4
|
-
import type { ModifyRspackConfigUtils, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig } from './config';
|
|
4
|
+
import type { ModifyRspackConfigUtils, NormalizedConfig, NormalizedEnvironmentConfig, RsbuildConfig, WebpackMerge } from './config';
|
|
5
5
|
import type { RsbuildContext } from './context';
|
|
6
6
|
import type { EnvironmentContext, ModifyBundlerChainFn, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn } from './hooks';
|
|
7
7
|
import type { RsbuildInstance, RsbuildTarget } from './rsbuild';
|
|
@@ -110,7 +110,7 @@ export type ModifyWebpackConfigUtils = ModifyWebpackChainUtils & {
|
|
|
110
110
|
prependPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
111
111
|
appendPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
112
112
|
removePlugin: (pluginName: string) => void;
|
|
113
|
-
mergeConfig:
|
|
113
|
+
mergeConfig: WebpackMerge;
|
|
114
114
|
};
|
|
115
115
|
export type ModifyWebpackChainFn = (chain: RspackChain, utils: ModifyWebpackChainUtils) => Promise<void> | void;
|
|
116
116
|
export type ModifyWebpackConfigFn = (config: WebpackConfig, utils: ModifyWebpackConfigUtils) => Promise<WebpackConfig | void> | WebpackConfig | void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.17",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"jiti": "^2.4.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@rslib/core": "0.5.
|
|
56
|
+
"@rslib/core": "0.5.3",
|
|
57
57
|
"@types/connect": "3.4.38",
|
|
58
|
-
"@types/node": "^22.13.
|
|
58
|
+
"@types/node": "^22.13.10",
|
|
59
59
|
"@types/on-finished": "2.3.4",
|
|
60
60
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
61
61
|
"@types/ws": "^8.18.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare function mergeUnique(key: string, uniques: string[], getter: (a: object) => string): (a: [], b: [], k: string) => false | any[];
|
|
2
|
-
|
|
3
|
-
type Key = string;
|
|
4
|
-
type Customize = (a: any, b: any, key: Key) => any;
|
|
5
|
-
interface ICustomizeOptions {
|
|
6
|
-
customizeArray?: Customize;
|
|
7
|
-
customizeObject?: Customize;
|
|
8
|
-
}
|
|
9
|
-
declare enum CustomizeRule {
|
|
10
|
-
Match = "match",
|
|
11
|
-
Merge = "merge",
|
|
12
|
-
Append = "append",
|
|
13
|
-
Prepend = "prepend",
|
|
14
|
-
Replace = "replace"
|
|
15
|
-
}
|
|
16
|
-
type CustomizeRuleString = "match" | "merge" | "append" | "prepend" | "replace";
|
|
17
|
-
|
|
18
|
-
declare function merge<Configuration extends object>(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]): Configuration;
|
|
19
|
-
declare function mergeWithCustomize<Configuration extends object>(options: ICustomizeOptions): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration;
|
|
20
|
-
declare function customizeArray(rules: {
|
|
21
|
-
[s: string]: CustomizeRule | CustomizeRuleString;
|
|
22
|
-
}): (a: any, b: any, key: Key) => any;
|
|
23
|
-
type Rules = {
|
|
24
|
-
[s: string]: CustomizeRule | CustomizeRuleString | Rules;
|
|
25
|
-
};
|
|
26
|
-
declare function mergeWithRules(rules: Rules): (firstConfiguration: object | object[], ...configurations: object[]) => object;
|
|
27
|
-
declare function customizeObject(rules: {
|
|
28
|
-
[s: string]: CustomizeRule | CustomizeRuleString;
|
|
29
|
-
}): (a: any, b: any, key: Key) => any;
|
|
30
|
-
|
|
31
|
-
export { CustomizeRule, customizeArray, customizeObject, merge as default, merge, mergeWithCustomize, mergeWithRules, mergeUnique as unique };
|