@rsbuild/core 2.0.11 → 2.0.13
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/connect-next/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/http-proxy-middleware/index.d.ts +80 -8
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-manifest-plugin/index.d.ts +4 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -1
- package/dist/756.js +646 -146
- package/dist/client/hmr.js +8 -3
- package/dist/connect-next.js +29 -26
- package/dist/http-proxy-middleware.js +64 -34
- package/dist/launch-editor-middleware.js +53 -44
- package/dist/manifest-plugin.js +7 -6
- package/dist/memfs.js +95 -95
- package/dist/sirv.js +1 -1
- package/dist-types/index.d.ts +1 -1
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +8 -3
- package/dist-types/types/config.d.ts +10 -5
- package/package.json +35 -35
- package/types.d.ts +4 -3
- package/dist/mrmime.js +0 -445
package/dist/sirv.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join, normalize, resolve, sep } from "node:path";
|
|
2
2
|
import { join as external_path_join, resolve as external_path_resolve } from "path";
|
|
3
3
|
import { readdirSync, statSync } from "fs";
|
|
4
|
-
import {
|
|
4
|
+
import { mrmime_lookup } from "./756.js";
|
|
5
5
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
6
6
|
import * as __rspack_external_node_querystring_aeb3c0b4 from "node:querystring";
|
|
7
7
|
function totalist(dir, callback, pre = '') {
|
package/dist-types/index.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ export type { RsbuildDevServer } from './server/devServer';
|
|
|
25
25
|
export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult } from './server/helper';
|
|
26
26
|
export type { RsbuildPreviewServer } from './server/previewServer';
|
|
27
27
|
// Types
|
|
28
|
-
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles } from './types';
|
|
28
|
+
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles, WebSocketUrlResolver } from './types';
|
|
@@ -17,15 +17,20 @@
|
|
|
17
17
|
*/ import type { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
18
18
|
import type { HtmlRspackPlugin, ResourceHintsOptions } from '../../types';
|
|
19
19
|
type LinkType = 'preload' | 'prefetch';
|
|
20
|
+
type ResourceHintsInputOptions = ResourceHintsOptions | ResourceHintsOptions[];
|
|
21
|
+
interface ResourceHintGroup {
|
|
22
|
+
links: HtmlRspackPlugin.HtmlTagObject[];
|
|
23
|
+
dedupe: boolean;
|
|
24
|
+
}
|
|
20
25
|
export declare class HtmlResourceHintsPlugin implements RspackPluginInstance {
|
|
21
|
-
readonly options: ResourceHintsOptions;
|
|
26
|
+
readonly options: ResourceHintsOptions[];
|
|
22
27
|
name: string;
|
|
23
|
-
resourceHints:
|
|
28
|
+
resourceHints: ResourceHintGroup[];
|
|
24
29
|
type: LinkType;
|
|
25
30
|
HTMLCount: number;
|
|
26
31
|
isDev: boolean;
|
|
27
32
|
getHTMLPlugin: () => typeof HtmlRspackPlugin;
|
|
28
|
-
constructor(options:
|
|
33
|
+
constructor(options: ResourceHintsInputOptions, type: LinkType, HTMLCount: number, isDev: boolean, getHTMLPlugin: () => typeof HtmlRspackPlugin);
|
|
29
34
|
apply(compiler: Compiler): void;
|
|
30
35
|
}
|
|
31
36
|
export { };
|
|
@@ -588,7 +588,7 @@ export interface PerformanceConfig {
|
|
|
588
588
|
/**
|
|
589
589
|
* Inject the `<link rel="preload">` tags for the static assets generated by Rsbuild.
|
|
590
590
|
*
|
|
591
|
-
* `performance.preload` can be set to an object to specify the options.
|
|
591
|
+
* `performance.preload` can be set to an object or an array of objects to specify the options.
|
|
592
592
|
*
|
|
593
593
|
* When `performance.preload` is set to `true`, Rsbuild will use the following default
|
|
594
594
|
* options to preload resources. This means preloading all async resources on the current
|
|
@@ -600,11 +600,11 @@ export interface PerformanceConfig {
|
|
|
600
600
|
* };
|
|
601
601
|
* ```
|
|
602
602
|
* @default undefined
|
|
603
|
-
*/ preload?: true | PreloadOptions
|
|
603
|
+
*/ preload?: true | OneOrMany<PreloadOptions>;
|
|
604
604
|
/**
|
|
605
605
|
* Inject the `<link rel="prefetch">` tags for the static assets generated by Rsbuild.
|
|
606
606
|
*
|
|
607
|
-
* `performance.prefetch` can be set to an object to specify the options.
|
|
607
|
+
* `performance.prefetch` can be set to an object or an array of objects to specify the options.
|
|
608
608
|
*
|
|
609
609
|
* When `performance.prefetch` is set to `true`, Rsbuild will use the following default
|
|
610
610
|
* options to prefetch resources. This means prefetching all async resources on the current
|
|
@@ -616,7 +616,7 @@ export interface PerformanceConfig {
|
|
|
616
616
|
* };
|
|
617
617
|
* ```
|
|
618
618
|
* @default undefined
|
|
619
|
-
*/ prefetch?: true | PrefetchOptions
|
|
619
|
+
*/ prefetch?: true | OneOrMany<PrefetchOptions>;
|
|
620
620
|
}
|
|
621
621
|
export interface NormalizedPerformanceConfig extends PerformanceConfig {
|
|
622
622
|
printFileSize: PrintFileSizeOptions | boolean;
|
|
@@ -1475,8 +1475,13 @@ export type ClientConfig = {
|
|
|
1475
1475
|
* Controls the log level for client-side logging in the browser console.
|
|
1476
1476
|
* @default 'info'
|
|
1477
1477
|
*/ logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
1478
|
+
/**
|
|
1479
|
+
* The path to a browser-side module that resolves the WebSocket URL.
|
|
1480
|
+
* The module should default export a function: `(url: string) => string`.
|
|
1481
|
+
*/ webSocketUrlResolver?: string;
|
|
1478
1482
|
};
|
|
1479
|
-
export type NormalizedClientConfig = Optional<Required<ClientConfig>, 'protocol'>;
|
|
1483
|
+
export type NormalizedClientConfig = Optional<Required<ClientConfig>, 'protocol' | 'webSocketUrlResolver'>;
|
|
1484
|
+
export type WebSocketUrlResolver = (url: string) => string;
|
|
1480
1485
|
export type { ChokidarOptions };
|
|
1481
1486
|
export type WatchFiles = {
|
|
1482
1487
|
/**
|
package/package.json
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/web-infra-dev/rsbuild/issues"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "https://github.com/web-infra-dev/rsbuild",
|
|
12
13
|
"directory": "packages/core"
|
|
13
14
|
},
|
|
14
|
-
"
|
|
15
|
+
"bin": {
|
|
16
|
+
"rsbuild": "./bin/rsbuild.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"bin",
|
|
20
|
+
"dist",
|
|
21
|
+
"dist-types",
|
|
22
|
+
"static",
|
|
23
|
+
"compiled",
|
|
24
|
+
"types.d.ts"
|
|
25
|
+
],
|
|
15
26
|
"type": "module",
|
|
27
|
+
"types": "./dist-types/index.d.ts",
|
|
16
28
|
"exports": {
|
|
17
29
|
".": {
|
|
18
30
|
"types": "./dist-types/index.d.ts",
|
|
@@ -23,53 +35,37 @@
|
|
|
23
35
|
},
|
|
24
36
|
"./package.json": "./package.json"
|
|
25
37
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
41
|
},
|
|
30
|
-
"files": [
|
|
31
|
-
"bin",
|
|
32
|
-
"dist",
|
|
33
|
-
"dist-types",
|
|
34
|
-
"static",
|
|
35
|
-
"compiled",
|
|
36
|
-
"types.d.ts"
|
|
37
|
-
],
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@rspack/core": "~2.0.
|
|
43
|
+
"@rspack/core": "~2.0.8",
|
|
40
44
|
"@swc/helpers": "^0.5.23"
|
|
41
45
|
},
|
|
42
|
-
"peerDependencies": {
|
|
43
|
-
"core-js": ">= 3.0.0"
|
|
44
|
-
},
|
|
45
|
-
"peerDependenciesMeta": {
|
|
46
|
-
"core-js": {
|
|
47
|
-
"optional": true
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
46
|
"devDependencies": {
|
|
51
47
|
"@jridgewell/remapping": "^2.3.5",
|
|
52
48
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
53
49
|
"@rslib/core": "0.22.0",
|
|
54
50
|
"@types/cors": "^2.8.19",
|
|
55
|
-
"@types/node": "^24.
|
|
51
|
+
"@types/node": "^24.13.1",
|
|
56
52
|
"@types/on-finished": "2.3.5",
|
|
57
53
|
"@types/range-parser": "^1.2.7",
|
|
58
54
|
"@types/ws": "^8.18.1",
|
|
59
|
-
"browserslist-load-config": "^1.0.
|
|
55
|
+
"browserslist-load-config": "^1.0.3",
|
|
60
56
|
"cac": "^7.0.0",
|
|
61
57
|
"chokidar": "^5.0.0",
|
|
62
|
-
"connect-next": "4.0.
|
|
58
|
+
"connect-next": "4.0.3",
|
|
63
59
|
"core-js": "^3.49.0",
|
|
64
60
|
"cors": "^2.8.6",
|
|
65
61
|
"css-loader": "7.1.4",
|
|
66
62
|
"deepmerge": "^4.3.1",
|
|
67
63
|
"dotenv-expand": "^13.0.0",
|
|
68
64
|
"html-rspack-plugin": "6.1.9",
|
|
69
|
-
"http-proxy-middleware": "4.
|
|
65
|
+
"http-proxy-middleware": "4.1.0",
|
|
70
66
|
"jiti": "^2.7.0",
|
|
71
|
-
"launch-editor-middleware": "^2.14.
|
|
72
|
-
"memfs": "^4.57.
|
|
67
|
+
"launch-editor-middleware": "^2.14.1",
|
|
68
|
+
"memfs": "^4.57.6",
|
|
73
69
|
"mrmime": "^2.0.1",
|
|
74
70
|
"on-finished": "2.4.1",
|
|
75
71
|
"open": "^11.0.0",
|
|
@@ -78,10 +74,10 @@
|
|
|
78
74
|
"postcss-loader": "8.2.1",
|
|
79
75
|
"prebundle": "1.6.5",
|
|
80
76
|
"range-parser": "^1.2.1",
|
|
81
|
-
"reduce-configs": "^2.0.
|
|
82
|
-
"rslog": "^2.1.
|
|
77
|
+
"reduce-configs": "^2.0.1",
|
|
78
|
+
"rslog": "^2.1.3",
|
|
83
79
|
"rspack-chain": "^2.0.2",
|
|
84
|
-
"rspack-manifest-plugin": "5.2.
|
|
80
|
+
"rspack-manifest-plugin": "5.2.2",
|
|
85
81
|
"rspack-merge": "1.0.1",
|
|
86
82
|
"sirv": "^3.0.2",
|
|
87
83
|
"stacktrace-parser": "^0.1.11",
|
|
@@ -90,13 +86,17 @@
|
|
|
90
86
|
"typescript": "^6.0.3",
|
|
91
87
|
"ws": "^8.21.0"
|
|
92
88
|
},
|
|
89
|
+
"peerDependencies": {
|
|
90
|
+
"core-js": ">= 3.0.0"
|
|
91
|
+
},
|
|
92
|
+
"peerDependenciesMeta": {
|
|
93
|
+
"core-js": {
|
|
94
|
+
"optional": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
93
97
|
"engines": {
|
|
94
98
|
"node": "^20.19.0 || >=22.12.0"
|
|
95
99
|
},
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"access": "public",
|
|
98
|
-
"registry": "https://registry.npmjs.org/"
|
|
99
|
-
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build": "rslib",
|
|
102
102
|
"dev": "rslib -w",
|
package/types.d.ts
CHANGED
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
* }
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
// rslint-disable-next-line @typescript-eslint/no-empty-
|
|
14
|
+
// rslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
15
15
|
interface RsbuildTypeOptions {}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* import.meta
|
|
19
19
|
*/
|
|
20
|
-
type ImportMetaEnvFallbackKey =
|
|
21
|
-
|
|
20
|
+
type ImportMetaEnvFallbackKey = 'strictImportMetaEnv' extends keyof RsbuildTypeOptions
|
|
21
|
+
? never
|
|
22
|
+
: string;
|
|
22
23
|
|
|
23
24
|
interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
|
|
24
25
|
/**
|