@rsbuild/core 1.2.3 → 1.2.5
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/compiled/css-loader/index.js +18 -18
- package/compiled/postcss-load-config/index.js +9 -3
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rsbuild-dev-middleware/index.js +177 -145
- package/compiled/rspack-chain/index.d.ts +2 -2
- package/compiled/rspack-chain/index.js +98 -71
- package/compiled/rspack-chain/license +22 -373
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/style-loader/index.js +10 -10
- package/dist/client/hmr.js +22 -13
- package/dist/index.cjs +143 -91
- package/dist/index.js +143 -91
- package/dist-types/cli/commands.d.ts +3 -0
- package/dist-types/config.d.ts +9 -1
- package/dist-types/configChain.d.ts +1 -2
- package/dist-types/index.d.ts +1 -1
- package/dist-types/plugins/basic.d.ts +1 -1
- package/dist-types/provider/createCompiler.d.ts +2 -1
- package/dist-types/provider/helpers.d.ts +1 -1
- package/dist-types/server/devMiddleware.d.ts +1 -1
- package/dist-types/server/helper.d.ts +1 -0
- package/dist-types/server/hmrFallback.d.ts +10 -0
- package/dist-types/types/config.d.ts +3 -12
- package/dist-types/types/hooks.d.ts +1 -0
- package/dist-types/types/plugin.d.ts +2 -2
- package/package.json +5 -5
|
@@ -50,6 +50,7 @@ export declare const getServerConfig: ({ config, }: {
|
|
|
50
50
|
https: boolean;
|
|
51
51
|
portTip: string | undefined;
|
|
52
52
|
}>;
|
|
53
|
+
export declare const isWildcardHost: (host: string) => boolean;
|
|
53
54
|
export declare const getHostInUrl: (host: string) => string;
|
|
54
55
|
type AddressUrl = {
|
|
55
56
|
label: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DevConfig, ServerConfig } from '../types/config';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if localhost resolves differently between node's default DNS lookup
|
|
4
|
+
* and explicit DNS lookup.
|
|
5
|
+
*
|
|
6
|
+
* Returns the resolved address if there's a difference, undefined otherwise.
|
|
7
|
+
* This helps detect cases where IPv4/IPv6 resolution might vary.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getLocalhostResolvedAddress(): Promise<string | undefined>;
|
|
10
|
+
export declare function getResolvedClientConfig(clientConfig: DevConfig['client'], serverConfig: ServerConfig): Promise<DevConfig['client']>;
|
|
@@ -174,7 +174,8 @@ export interface NormalizedSourceConfig extends SourceConfig {
|
|
|
174
174
|
decorators: Required<Decorators>;
|
|
175
175
|
}
|
|
176
176
|
export type HtmlFallback = false | 'index';
|
|
177
|
-
export type ProxyBypass = (req: IncomingMessage, res: ServerResponse, proxyOptions: ProxyOptions) => string | undefined | null | boolean
|
|
177
|
+
export type ProxyBypass = (req: IncomingMessage, res: ServerResponse, proxyOptions: ProxyOptions) => MaybePromise<string | undefined | null | boolean>;
|
|
178
|
+
export type { ProxyFilter };
|
|
178
179
|
export type ProxyOptions = HttpProxyOptions & {
|
|
179
180
|
/**
|
|
180
181
|
* Bypass the proxy based on the return value of a function.
|
|
@@ -182,6 +183,7 @@ export type ProxyOptions = HttpProxyOptions & {
|
|
|
182
183
|
* - Return `true` to continue processing the request without proxy.
|
|
183
184
|
* - Return `false` to produce a 404 error for the request.
|
|
184
185
|
* - Return a path to serve from, instead of continuing to proxy the request.
|
|
186
|
+
* - Return a Promise to handle the request asynchronously.
|
|
185
187
|
*/
|
|
186
188
|
bypass?: ProxyBypass;
|
|
187
189
|
/**
|
|
@@ -446,7 +448,6 @@ export interface PerformanceConfig {
|
|
|
446
448
|
}
|
|
447
449
|
export interface NormalizedPerformanceConfig extends PerformanceConfig {
|
|
448
450
|
printFileSize: PrintFileSizeOptions | boolean;
|
|
449
|
-
buildCache: BuildCacheOptions | boolean;
|
|
450
451
|
chunkSplit: RsbuildChunkSplit;
|
|
451
452
|
}
|
|
452
453
|
export type SplitChunks = Configuration extends {
|
|
@@ -454,16 +455,6 @@ export type SplitChunks = Configuration extends {
|
|
|
454
455
|
splitChunks?: infer P;
|
|
455
456
|
};
|
|
456
457
|
} ? P : never;
|
|
457
|
-
export type CacheGroups = Configuration extends {
|
|
458
|
-
optimization?: {
|
|
459
|
-
splitChunks?: {
|
|
460
|
-
cacheGroups?: infer P;
|
|
461
|
-
} | false;
|
|
462
|
-
};
|
|
463
|
-
} ? P : never;
|
|
464
|
-
export type CacheGroup = CacheGroups extends {
|
|
465
|
-
[key: string]: infer P;
|
|
466
|
-
} ? P : null;
|
|
467
458
|
export type ForceSplitting = RegExp[] | Record<string, RegExp>;
|
|
468
459
|
export interface BaseSplitRules {
|
|
469
460
|
strategy?: string;
|
|
@@ -135,6 +135,7 @@ export type ModifyBundlerChainUtils = ModifyChainUtils & {
|
|
|
135
135
|
DefinePlugin: PluginInstance;
|
|
136
136
|
IgnorePlugin: PluginInstance;
|
|
137
137
|
ProvidePlugin: PluginInstance;
|
|
138
|
+
SourceMapDevToolPlugin: PluginInstance;
|
|
138
139
|
HotModuleReplacementPlugin: PluginInstance;
|
|
139
140
|
};
|
|
140
141
|
};
|
|
@@ -322,9 +322,9 @@ export type RsbuildPluginAPI = Readonly<{
|
|
|
322
322
|
modifyBundlerChain: PluginHook<ModifyBundlerChainFn>;
|
|
323
323
|
/** Only works when bundler is Rspack */
|
|
324
324
|
modifyRspackConfig: PluginHook<ModifyRspackConfigFn>;
|
|
325
|
-
/** Only works when bundler is
|
|
325
|
+
/** Only works when bundler is webpack */
|
|
326
326
|
modifyWebpackChain: PluginHook<ModifyWebpackChainFn>;
|
|
327
|
-
/** Only works when bundler is
|
|
327
|
+
/** Only works when bundler is webpack */
|
|
328
328
|
modifyWebpackConfig: PluginHook<ModifyWebpackConfigFn>;
|
|
329
329
|
getRsbuildConfig: GetRsbuildConfig;
|
|
330
330
|
getNormalizedConfig: typeof getNormalizedConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"core-js": "~3.40.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@rslib/core": "0.
|
|
55
|
+
"@rslib/core": "0.4.1",
|
|
56
56
|
"@types/connect": "3.4.38",
|
|
57
|
-
"@types/node": "^22.
|
|
57
|
+
"@types/node": "^22.13.1",
|
|
58
58
|
"@types/on-finished": "2.3.4",
|
|
59
59
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
60
|
-
"@types/ws": "^8.5.
|
|
60
|
+
"@types/ws": "^8.5.14",
|
|
61
61
|
"browserslist-load-config": "1.0.0",
|
|
62
62
|
"cac": "^6.7.14",
|
|
63
63
|
"chokidar": "^4.0.3",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"reduce-configs": "^1.1.0",
|
|
84
84
|
"rsbuild-dev-middleware": "0.1.2",
|
|
85
85
|
"rslog": "^1.2.3",
|
|
86
|
-
"rspack-chain": "^1.
|
|
86
|
+
"rspack-chain": "^1.2.1",
|
|
87
87
|
"rspack-manifest-plugin": "5.0.3",
|
|
88
88
|
"sirv": "^3.0.0",
|
|
89
89
|
"style-loader": "3.3.4",
|