@rspack-debug/browser 2.0.0-canary-20260116 → 2.0.0-rc.0
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/BuildInfo.d.ts +3 -3
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +6 -3
- package/dist/Compiler.d.ts +5 -2
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/Diagnostics.d.ts +1 -1
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Module.d.ts +3 -3
- package/dist/ModuleGraph.d.ts +2 -1
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +2 -3
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Resolver.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
- package/dist/browser/fs.d.ts +1 -1
- package/dist/browser/middleware.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +11 -9
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/index.d.ts +2 -2
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +36 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +5 -1
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +5 -4
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -2
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/defaults.d.ts +4 -2
- package/dist/config/devServer.d.ts +102 -237
- package/dist/config/normalization.d.ts +2 -3
- package/dist/config/target.d.ts +14 -11
- package/dist/config/types.d.ts +152 -63
- package/dist/container/ContainerPlugin.d.ts +4 -3
- package/dist/container/ContainerReferencePlugin.d.ts +5 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +11 -4
- package/dist/container/ModuleFederationPlugin.d.ts +20 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
- package/dist/exports.d.ts +13 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +43927 -8544
- package/dist/index.js.LICENSE.txt +7 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +1 -1
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/napi-binding.d.ts +248 -101
- package/dist/rspack.wasi-browser.js +7 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +17 -4
- package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +23 -3
- package/dist/sharing/SharePlugin.d.ts +43 -5
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/StatsFactory.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +2 -2
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/source.d.ts +1 -1
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/wasi-worker-browser.mjs +26464 -22498
- package/package.json +6 -7
- package/dist/builtin-loader/index.d.ts +0 -1
- package/dist/rslib-runtime.js +0 -58
|
@@ -7,32 +7,26 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
14
|
-
import type {
|
|
10
|
+
import type { ReadStream } from 'node:fs';
|
|
11
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
12
|
+
import type { ServerOptions } from 'node:https';
|
|
13
|
+
import type { Server as ConnectApplication, NextFunction } from 'connect-next';
|
|
14
|
+
import type { Filter as ProxyFilter, Options as ProxyOptions } from 'http-proxy-middleware';
|
|
15
|
+
import type { Options as OpenOptions } from 'open';
|
|
16
|
+
import type { Compiler, Configuration, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from '..';
|
|
15
17
|
type Logger = ReturnType<Compiler['getInfrastructureLogger']>;
|
|
16
18
|
type MultiWatching = MultiCompiler['watch'];
|
|
17
|
-
type
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
|
|
21
|
-
type ServerOptions = import('https').ServerOptions & {
|
|
22
|
-
spdy?: {
|
|
23
|
-
plain?: boolean | undefined;
|
|
24
|
-
ssl?: boolean | undefined;
|
|
25
|
-
'x-forwarded-for'?: string | undefined;
|
|
26
|
-
protocol?: string | undefined;
|
|
27
|
-
protocols?: string[] | undefined;
|
|
28
|
-
};
|
|
19
|
+
export type DevServerHost = LiteralUnion<'local-ip' | 'local-ipv4' | 'local-ipv6', string>;
|
|
20
|
+
type BasicServer = import('node:net').Server | import('node:tls').Server;
|
|
21
|
+
export type DevServerOpenOptions = OpenOptions & {
|
|
22
|
+
target?: string | string[];
|
|
29
23
|
};
|
|
30
24
|
type ResponseData = {
|
|
31
25
|
data: Buffer | ReadStream;
|
|
32
26
|
byteLength: number;
|
|
33
27
|
};
|
|
34
|
-
type ModifyResponseData<
|
|
35
|
-
type
|
|
28
|
+
type ModifyResponseData<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (req: Req, res: Res, data: Buffer | ReadStream, byteLength: number) => ResponseData;
|
|
29
|
+
export type DevServerHeaders = {
|
|
36
30
|
key: string;
|
|
37
31
|
value: string;
|
|
38
32
|
}[] | Record<string, string | string[]>;
|
|
@@ -40,7 +34,6 @@ type OutputFileSystem = import('..').OutputFileSystem & {
|
|
|
40
34
|
statSync: import('fs').StatSyncFn;
|
|
41
35
|
readFileSync: typeof import('fs').readFileSync;
|
|
42
36
|
};
|
|
43
|
-
type RspackConfiguration = import('..').Configuration;
|
|
44
37
|
type Port = number | LiteralUnion<'auto', string>;
|
|
45
38
|
type HistoryContext = {
|
|
46
39
|
readonly match: RegExpMatchArray;
|
|
@@ -53,88 +46,75 @@ type Rewrite = {
|
|
|
53
46
|
readonly to: string | RegExp | RewriteTo;
|
|
54
47
|
};
|
|
55
48
|
type HistoryApiFallbackOptions = {
|
|
56
|
-
readonly disableDotRule?: true
|
|
57
|
-
readonly htmlAcceptHeaders?: readonly string[]
|
|
58
|
-
readonly index?: string
|
|
59
|
-
readonly logger?: typeof console.log
|
|
60
|
-
readonly rewrites?: readonly Rewrite[]
|
|
61
|
-
readonly verbose?: boolean
|
|
62
|
-
};
|
|
63
|
-
type DevMiddlewareOptions<
|
|
49
|
+
readonly disableDotRule?: true;
|
|
50
|
+
readonly htmlAcceptHeaders?: readonly string[];
|
|
51
|
+
readonly index?: string;
|
|
52
|
+
readonly logger?: typeof console.log;
|
|
53
|
+
readonly rewrites?: readonly Rewrite[];
|
|
54
|
+
readonly verbose?: boolean;
|
|
55
|
+
};
|
|
56
|
+
type DevMiddlewareOptions<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = {
|
|
64
57
|
mimeTypes?: {
|
|
65
58
|
[key: string]: string;
|
|
66
|
-
}
|
|
67
|
-
mimeTypeDefault?: string
|
|
68
|
-
writeToDisk?: boolean | ((targetPath: string) => boolean)
|
|
69
|
-
methods?: string[]
|
|
59
|
+
};
|
|
60
|
+
mimeTypeDefault?: string;
|
|
61
|
+
writeToDisk?: boolean | ((targetPath: string) => boolean);
|
|
62
|
+
methods?: string[];
|
|
70
63
|
headers?: any;
|
|
71
|
-
publicPath?: NonNullable<
|
|
72
|
-
stats?:
|
|
73
|
-
serverSideRender?: boolean
|
|
74
|
-
outputFileSystem?: OutputFileSystem
|
|
75
|
-
index?: string | boolean
|
|
76
|
-
modifyResponseData?: ModifyResponseData<
|
|
77
|
-
etag?: 'strong' | 'weak'
|
|
78
|
-
lastModified?: boolean
|
|
64
|
+
publicPath?: NonNullable<Configuration['output']>['publicPath'];
|
|
65
|
+
stats?: Configuration['stats'];
|
|
66
|
+
serverSideRender?: boolean;
|
|
67
|
+
outputFileSystem?: OutputFileSystem;
|
|
68
|
+
index?: string | boolean;
|
|
69
|
+
modifyResponseData?: ModifyResponseData<Req, Res>;
|
|
70
|
+
etag?: 'strong' | 'weak';
|
|
71
|
+
lastModified?: boolean;
|
|
79
72
|
cacheControl?: string | number | boolean | {
|
|
80
73
|
maxAge?: number;
|
|
81
74
|
immutable?: boolean;
|
|
82
|
-
}
|
|
83
|
-
cacheImmutable?: boolean
|
|
75
|
+
};
|
|
76
|
+
cacheImmutable?: boolean;
|
|
84
77
|
};
|
|
85
78
|
type BasicApplication = any;
|
|
86
|
-
type BonjourServer = Record<string, any>;
|
|
87
79
|
type ChokidarWatchOptions = {
|
|
88
80
|
[key: string]: any;
|
|
89
81
|
};
|
|
90
|
-
type ServeIndexOptions = {
|
|
91
|
-
[key: string]: any;
|
|
92
|
-
};
|
|
93
82
|
type ServeStaticOptions = {
|
|
94
83
|
[key: string]: any;
|
|
95
84
|
};
|
|
96
|
-
type HttpProxyMiddlewareOptionsFilter = any;
|
|
97
|
-
type Request = IncomingMessage;
|
|
98
|
-
type Response = ServerResponse;
|
|
99
85
|
type WatchFiles = {
|
|
100
86
|
paths: string | string[];
|
|
101
|
-
options?:
|
|
87
|
+
options?: ChokidarWatchOptions & {
|
|
102
88
|
aggregateTimeout?: number;
|
|
103
|
-
ignored?: ChokidarWatchOptions['ignored'];
|
|
104
89
|
poll?: number | boolean;
|
|
105
|
-
}
|
|
90
|
+
};
|
|
106
91
|
};
|
|
107
|
-
type
|
|
108
|
-
directory?: string
|
|
109
|
-
publicPath?: string | string[]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
watch?: boolean | (ChokidarWatchOptions & {
|
|
113
|
-
aggregateTimeout?: number;
|
|
114
|
-
ignored?: ChokidarWatchOptions['ignored'];
|
|
115
|
-
poll?: number | boolean;
|
|
116
|
-
}) | undefined;
|
|
92
|
+
export type DevServerStaticItem = {
|
|
93
|
+
directory?: string;
|
|
94
|
+
publicPath?: string | string[];
|
|
95
|
+
staticOptions?: ServeStaticOptions;
|
|
96
|
+
watch?: boolean | NonNullable<WatchFiles['options']>;
|
|
117
97
|
};
|
|
118
|
-
type
|
|
119
|
-
type
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
export type DevServerStatic = string | boolean | DevServerStaticItem | (string | DevServerStaticItem)[];
|
|
99
|
+
type ServerType<A extends BasicApplication, S extends BasicServer> = LiteralUnion<'http' | 'https' | 'http2', string> | ((arg0: ServerOptions, arg1: A) => S);
|
|
100
|
+
type ServerConfiguration<A extends BasicApplication, S extends BasicServer> = {
|
|
101
|
+
type?: ServerType<A, S>;
|
|
102
|
+
options?: ServerOptions;
|
|
122
103
|
};
|
|
123
104
|
type WebSocketServerConfiguration = {
|
|
124
|
-
type?: string | Function
|
|
125
|
-
options?: Record<string, any
|
|
126
|
-
};
|
|
127
|
-
type
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} &
|
|
134
|
-
type
|
|
135
|
-
type ProxyConfigArray = (ProxyConfigArrayItem | ((req?: Request, res?: Response, next?: NextFunction) => ProxyConfigArrayItem))[];
|
|
105
|
+
type?: string | Function;
|
|
106
|
+
options?: Record<string, any>;
|
|
107
|
+
};
|
|
108
|
+
export type DevServerProxyConfigArrayItem = {
|
|
109
|
+
/**
|
|
110
|
+
* Alias for `pathFilter` in `http-proxy-middleware` options.
|
|
111
|
+
* When both `context` and `pathFilter` are provided, `pathFilter` takes precedence.
|
|
112
|
+
*/
|
|
113
|
+
context?: ProxyFilter;
|
|
114
|
+
} & ProxyOptions;
|
|
115
|
+
export type DevServerProxyConfigArray = (DevServerProxyConfigArrayItem | ((req?: IncomingMessage, res?: ServerResponse, next?: NextFunction) => DevServerProxyConfigArrayItem))[];
|
|
136
116
|
type Callback = (stats?: Stats | MultiStats) => any;
|
|
137
|
-
type DevMiddlewareContext
|
|
117
|
+
type DevMiddlewareContext = {
|
|
138
118
|
state: boolean;
|
|
139
119
|
stats: Stats | MultiStats | undefined;
|
|
140
120
|
callbacks: Callback[];
|
|
@@ -144,171 +124,56 @@ type DevMiddlewareContext<_RequestInternal extends IncomingMessage = IncomingMes
|
|
|
144
124
|
logger: Logger;
|
|
145
125
|
outputFileSystem: OutputFileSystem;
|
|
146
126
|
};
|
|
147
|
-
type
|
|
148
|
-
export type
|
|
149
|
-
type
|
|
127
|
+
export type DevServerMiddlewareHandler<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (req: Req, res: Res, next: NextFunction) => void | Promise<void>;
|
|
128
|
+
export type DevServerMiddlewareErrorHandler<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = (error: any, req: Req, res: Res, next: NextFunction) => void | Promise<void>;
|
|
129
|
+
export type DevServerMiddlewareObject<Req extends IncomingMessage = IncomingMessage, Res extends ServerResponse = ServerResponse> = {
|
|
150
130
|
name?: string;
|
|
151
131
|
path?: string;
|
|
152
|
-
middleware:
|
|
153
|
-
};
|
|
154
|
-
export type Middleware<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = MiddlewareObject<RequestInternal, ResponseInternal> | MiddlewareHandler<RequestInternal, ResponseInternal>;
|
|
155
|
-
type OpenApp = {
|
|
156
|
-
name?: string | undefined;
|
|
157
|
-
arguments?: string[] | undefined;
|
|
158
|
-
};
|
|
159
|
-
type Open = {
|
|
160
|
-
app?: string | string[] | OpenApp | undefined;
|
|
161
|
-
target?: string | string[] | undefined;
|
|
132
|
+
middleware: DevServerMiddlewareHandler<Req, Res> | DevServerMiddlewareErrorHandler<Req, Res>;
|
|
162
133
|
};
|
|
134
|
+
export type DevServerMiddleware = DevServerMiddlewareObject | DevServerMiddlewareHandler | DevServerMiddlewareErrorHandler;
|
|
163
135
|
type OverlayMessageOptions = boolean | ((error: Error) => void);
|
|
164
|
-
type
|
|
165
|
-
hostname?: string
|
|
166
|
-
password?: string
|
|
167
|
-
pathname?: string
|
|
168
|
-
port?: string | number
|
|
169
|
-
protocol?: string
|
|
170
|
-
username?: string
|
|
171
|
-
};
|
|
172
|
-
type
|
|
173
|
-
logging?: 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose'
|
|
136
|
+
export type DevServerWebSocketURL = {
|
|
137
|
+
hostname?: string;
|
|
138
|
+
password?: string;
|
|
139
|
+
pathname?: string;
|
|
140
|
+
port?: string | number;
|
|
141
|
+
protocol?: string;
|
|
142
|
+
username?: string;
|
|
143
|
+
};
|
|
144
|
+
export type DevServerClient = {
|
|
145
|
+
logging?: 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
|
|
174
146
|
overlay?: boolean | {
|
|
175
147
|
warnings?: OverlayMessageOptions;
|
|
176
148
|
errors?: OverlayMessageOptions;
|
|
177
149
|
runtimeErrors?: OverlayMessageOptions;
|
|
178
|
-
}
|
|
179
|
-
progress?: boolean
|
|
180
|
-
reconnect?: number | boolean
|
|
181
|
-
webSocketTransport?: string
|
|
182
|
-
webSocketURL?: string |
|
|
183
|
-
};
|
|
184
|
-
export type DevServerOptions<A extends BasicApplication =
|
|
185
|
-
ipc?: string | boolean
|
|
186
|
-
host?:
|
|
187
|
-
port?: Port
|
|
188
|
-
hot?: boolean | 'only'
|
|
189
|
-
liveReload?: boolean
|
|
190
|
-
devMiddleware?: DevMiddlewareOptions
|
|
191
|
-
compress?: boolean
|
|
192
|
-
allowedHosts?: string | string[]
|
|
193
|
-
historyApiFallback?: boolean | HistoryApiFallbackOptions
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
setupMiddlewares?: ((middlewares: Middleware[], devServer: Server) => Middleware[]) | undefined;
|
|
150
|
+
};
|
|
151
|
+
progress?: boolean;
|
|
152
|
+
reconnect?: number | boolean;
|
|
153
|
+
webSocketTransport?: LiteralUnion<'ws', string>;
|
|
154
|
+
webSocketURL?: string | DevServerWebSocketURL;
|
|
155
|
+
};
|
|
156
|
+
export type DevServerOptions<A extends BasicApplication = ConnectApplication, S extends BasicServer = BasicServer> = {
|
|
157
|
+
ipc?: string | boolean;
|
|
158
|
+
host?: DevServerHost;
|
|
159
|
+
port?: Port;
|
|
160
|
+
hot?: boolean | 'only';
|
|
161
|
+
liveReload?: boolean;
|
|
162
|
+
devMiddleware?: DevMiddlewareOptions;
|
|
163
|
+
compress?: boolean;
|
|
164
|
+
allowedHosts?: LiteralUnion<'auto' | 'all', string> | string[];
|
|
165
|
+
historyApiFallback?: boolean | HistoryApiFallbackOptions;
|
|
166
|
+
watchFiles?: string | string[] | WatchFiles | (string | WatchFiles)[];
|
|
167
|
+
static?: DevServerStatic;
|
|
168
|
+
server?: ServerType<A, S> | ServerConfiguration<A, S>;
|
|
169
|
+
app?: () => Promise<A>;
|
|
170
|
+
webSocketServer?: boolean | LiteralUnion<'ws', string> | WebSocketServerConfiguration;
|
|
171
|
+
proxy?: DevServerProxyConfigArray;
|
|
172
|
+
open?: string | boolean | DevServerOpenOptions | (string | DevServerOpenOptions)[];
|
|
173
|
+
setupExitSignals?: boolean;
|
|
174
|
+
client?: boolean | DevServerClient;
|
|
175
|
+
headers?: DevServerHeaders | ((req: IncomingMessage, res: ServerResponse, context: DevMiddlewareContext | undefined) => DevServerHeaders);
|
|
176
|
+
onListening?: (devServer: any) => void;
|
|
177
|
+
setupMiddlewares?: (middlewares: DevServerMiddleware[], devServer: any) => DevServerMiddleware[];
|
|
207
178
|
};
|
|
208
|
-
interface HttpProxyMiddlewareOptions extends HttpProxyServerOptions {
|
|
209
|
-
pathRewrite?: {
|
|
210
|
-
[regexp: string]: string;
|
|
211
|
-
} | ((path: string, req: Request) => string) | ((path: string, req: Request) => Promise<string>);
|
|
212
|
-
router?: {
|
|
213
|
-
[hostOrPath: string]: HttpProxyServerOptions['target'];
|
|
214
|
-
} | ((req: Request) => HttpProxyServerOptions['target']) | ((req: Request) => Promise<HttpProxyServerOptions['target']>);
|
|
215
|
-
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
216
|
-
logProvider?: LogProviderCallback;
|
|
217
|
-
onError?: OnErrorCallback;
|
|
218
|
-
onProxyRes?: OnProxyResCallback;
|
|
219
|
-
onProxyReq?: OnProxyReqCallback;
|
|
220
|
-
onProxyReqWs?: OnProxyReqWsCallback;
|
|
221
|
-
onOpen?: OnOpenCallback;
|
|
222
|
-
onClose?: OnCloseCallback;
|
|
223
|
-
}
|
|
224
|
-
interface LogProvider {
|
|
225
|
-
log: Logger;
|
|
226
|
-
debug?: Logger;
|
|
227
|
-
info?: Logger;
|
|
228
|
-
warn?: Logger;
|
|
229
|
-
error?: Logger;
|
|
230
|
-
}
|
|
231
|
-
type LogProviderCallback = (provider: LogProvider) => LogProvider;
|
|
232
|
-
type OnErrorCallback = (err: Error, req: Request, res: Response, target?: string | Partial<url.Url>) => void;
|
|
233
|
-
type OnProxyResCallback = (proxyRes: http.IncomingMessage, req: Request, res: Response) => void;
|
|
234
|
-
type OnProxyReqCallback = (proxyReq: http.ClientRequest, req: Request, res: Response, options: HttpProxyServerOptions) => void;
|
|
235
|
-
type OnProxyReqWsCallback = (proxyReq: http.ClientRequest, req: Request, socket: net.Socket, options: HttpProxyServerOptions, head: any) => void;
|
|
236
|
-
type OnCloseCallback = (proxyRes: Response, proxySocket: net.Socket, proxyHead: any) => void;
|
|
237
|
-
type OnOpenCallback = (proxySocket: net.Socket) => void;
|
|
238
|
-
interface HttpProxyServerOptions {
|
|
239
|
-
/** URL string to be parsed with the url module. */
|
|
240
|
-
target?: HttpProxyTarget | undefined;
|
|
241
|
-
/** URL string to be parsed with the url module. */
|
|
242
|
-
forward?: HttpProxyTargetUrl | undefined;
|
|
243
|
-
/** Object to be passed to http(s).request. */
|
|
244
|
-
agent?: any;
|
|
245
|
-
/** Object to be passed to https.createServer(). */
|
|
246
|
-
ssl?: any;
|
|
247
|
-
/** If you want to proxy websockets. */
|
|
248
|
-
ws?: boolean | undefined;
|
|
249
|
-
/** Adds x- forward headers. */
|
|
250
|
-
xfwd?: boolean | undefined;
|
|
251
|
-
/** Verify SSL certificate. */
|
|
252
|
-
secure?: boolean | undefined;
|
|
253
|
-
/** Explicitly specify if we are proxying to another proxy. */
|
|
254
|
-
toProxy?: boolean | undefined;
|
|
255
|
-
/** Specify whether you want to prepend the target's path to the proxy path. */
|
|
256
|
-
prependPath?: boolean | undefined;
|
|
257
|
-
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
|
258
|
-
ignorePath?: boolean | undefined;
|
|
259
|
-
/** Local interface string to bind for outgoing connections. */
|
|
260
|
-
localAddress?: string | undefined;
|
|
261
|
-
/** Changes the origin of the host header to the target URL. */
|
|
262
|
-
changeOrigin?: boolean | undefined;
|
|
263
|
-
/** specify whether you want to keep letter case of response header key */
|
|
264
|
-
preserveHeaderKeyCase?: boolean | undefined;
|
|
265
|
-
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
|
266
|
-
auth?: string | undefined;
|
|
267
|
-
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
|
268
|
-
hostRewrite?: string | undefined;
|
|
269
|
-
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
|
270
|
-
autoRewrite?: boolean | undefined;
|
|
271
|
-
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
|
272
|
-
protocolRewrite?: string | undefined;
|
|
273
|
-
/** rewrites domain of set-cookie headers. */
|
|
274
|
-
cookieDomainRewrite?: false | string | {
|
|
275
|
-
[oldDomain: string]: string;
|
|
276
|
-
} | undefined;
|
|
277
|
-
/** rewrites path of set-cookie headers. Default: false */
|
|
278
|
-
cookiePathRewrite?: false | string | {
|
|
279
|
-
[oldPath: string]: string;
|
|
280
|
-
} | undefined;
|
|
281
|
-
/** object with extra headers to be added to target requests. */
|
|
282
|
-
headers?: {
|
|
283
|
-
[header: string]: string;
|
|
284
|
-
} | undefined;
|
|
285
|
-
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
|
286
|
-
proxyTimeout?: number | undefined;
|
|
287
|
-
/** Timeout (in milliseconds) for incoming requests */
|
|
288
|
-
timeout?: number | undefined;
|
|
289
|
-
/** Specify whether you want to follow redirects. Default: false */
|
|
290
|
-
followRedirects?: boolean | undefined;
|
|
291
|
-
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
|
292
|
-
selfHandleResponse?: boolean | undefined;
|
|
293
|
-
/** Buffer */
|
|
294
|
-
buffer?: stream.Stream | undefined;
|
|
295
|
-
/** Explicitly set the method type of the ProxyReq */
|
|
296
|
-
method?: string | undefined;
|
|
297
|
-
}
|
|
298
|
-
interface HttpProxyTargetDetailed {
|
|
299
|
-
host: string;
|
|
300
|
-
port: number;
|
|
301
|
-
protocol?: string | undefined;
|
|
302
|
-
hostname?: string | undefined;
|
|
303
|
-
socketPath?: string | undefined;
|
|
304
|
-
key?: string | undefined;
|
|
305
|
-
passphrase?: string | undefined;
|
|
306
|
-
pfx?: Buffer | string | undefined;
|
|
307
|
-
cert?: string | undefined;
|
|
308
|
-
ca?: string | undefined;
|
|
309
|
-
ciphers?: string | undefined;
|
|
310
|
-
secureProtocol?: string | undefined;
|
|
311
|
-
}
|
|
312
|
-
type HttpProxyTarget = HttpProxyTargetUrl | HttpProxyTargetDetailed;
|
|
313
|
-
type HttpProxyTargetUrl = string | Partial<url.Url>;
|
|
314
179
|
export {};
|
|
@@ -76,7 +76,6 @@ export interface ModuleOptionsNormalized {
|
|
|
76
76
|
parser: ParserOptionsByModuleType;
|
|
77
77
|
generator: GeneratorOptionsByModuleType;
|
|
78
78
|
noParse?: NoParseOption;
|
|
79
|
-
unsafeCache?: boolean | RegExp;
|
|
80
79
|
}
|
|
81
80
|
export type CacheNormalized = boolean | {
|
|
82
81
|
type: 'memory';
|
|
@@ -93,12 +92,11 @@ export type CacheNormalized = boolean | {
|
|
|
93
92
|
type: 'filesystem';
|
|
94
93
|
directory: string;
|
|
95
94
|
};
|
|
95
|
+
portable?: boolean;
|
|
96
96
|
};
|
|
97
97
|
export interface ExperimentsNormalized {
|
|
98
98
|
asyncWebAssembly?: boolean;
|
|
99
|
-
outputModule?: boolean;
|
|
100
99
|
css?: boolean;
|
|
101
|
-
incremental?: false | Incremental;
|
|
102
100
|
futureDefaults?: boolean;
|
|
103
101
|
buildHttp?: HttpUriPluginOptions;
|
|
104
102
|
useInputFileSystem?: false | RegExp[];
|
|
@@ -136,6 +134,7 @@ export interface RspackOptionsNormalized {
|
|
|
136
134
|
plugins: Plugins;
|
|
137
135
|
experiments: ExperimentsNormalized;
|
|
138
136
|
lazyCompilation?: false | LazyCompilationOptions;
|
|
137
|
+
incremental?: false | Incremental;
|
|
139
138
|
watch?: Watch;
|
|
140
139
|
watchOptions: WatchOptions;
|
|
141
140
|
devServer?: DevServer;
|
package/dist/config/target.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/target.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
1
10
|
/**
|
|
2
11
|
* @param context the context directory
|
|
3
12
|
* @returns default target
|
|
@@ -73,21 +82,15 @@ export type EcmaTargetProperties = {
|
|
|
73
82
|
/** async functions and await are available */
|
|
74
83
|
asyncFunction: boolean | null;
|
|
75
84
|
};
|
|
85
|
+
export type ExtractedTargetProperties = {
|
|
86
|
+
esVersion?: number | null;
|
|
87
|
+
targets?: Record<string, string> | null;
|
|
88
|
+
};
|
|
76
89
|
type Never<T> = {
|
|
77
90
|
[P in keyof T]?: never;
|
|
78
91
|
};
|
|
79
92
|
type Mix<A, B> = (A & Never<B>) | (Never<A> & B) | (A & B);
|
|
80
|
-
export type TargetProperties = Mix<Mix<PlatformTargetProperties, ElectronContextTargetProperties>, Mix<ApiTargetProperties, EcmaTargetProperties
|
|
81
|
-
/**
|
|
82
|
-
* @param target the target
|
|
83
|
-
* @param context the context directory
|
|
84
|
-
* @returns target properties
|
|
85
|
-
*/
|
|
93
|
+
export type TargetProperties = Mix<Mix<PlatformTargetProperties, ElectronContextTargetProperties>, Mix<ApiTargetProperties, EcmaTargetProperties>> & ExtractedTargetProperties;
|
|
86
94
|
export declare const getTargetProperties: (target: string, context: string) => TargetProperties;
|
|
87
|
-
/**
|
|
88
|
-
* @param targets the targets
|
|
89
|
-
* @param context the context directory
|
|
90
|
-
* @returns target properties
|
|
91
|
-
*/
|
|
92
95
|
export declare const getTargetsProperties: (targets: string[], context: string) => TargetProperties;
|
|
93
96
|
export {};
|