@rspack-debug/core 2.0.0-rc.0 → 2.0.0-rc.3
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/dist/ModuleGraph.d.ts +2 -1
- package/dist/ModuleGraphConnection.d.ts +10 -0
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/devServer.d.ts +2 -2
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +56 -20
- package/dist/exports.d.ts +9 -1
- package/dist/index.js +116 -54
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/dist/worker.js +1 -1
- package/package.json +7 -7
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"connect-next","author":"TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)","version":"4.0.
|
|
1
|
+
{"name":"connect-next","author":"TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)","version":"4.0.1","license":"MIT","types":"index.d.ts","type":"module"}
|
package/dist/ModuleGraph.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Dependency, JsModuleGraph
|
|
1
|
+
import type { Dependency, JsModuleGraph } from '@rspack/binding';
|
|
2
2
|
import { ExportsInfo } from './ExportsInfo.js';
|
|
3
|
+
import type { ModuleGraphConnection } from './ModuleGraphConnection.js';
|
|
3
4
|
import type { Module } from './Module.js';
|
|
4
5
|
export default class ModuleGraph {
|
|
5
6
|
#private;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import binding, { ModuleGraphConnection as BindingModuleGraphConnection } from '@rspack/binding';
|
|
2
|
+
type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
|
|
3
|
+
readonly TRANSITIVE_ONLY: typeof binding.TRANSITIVE_ONLY_SYMBOL;
|
|
4
|
+
readonly CIRCULAR_CONNECTION: typeof binding.CIRCULAR_CONNECTION_SYMBOL;
|
|
5
|
+
};
|
|
6
|
+
export interface ModuleGraphConnection extends BindingModuleGraphConnection {
|
|
7
|
+
}
|
|
8
|
+
export declare const ModuleGraphConnection: ModuleGraphConnectionConstructor;
|
|
9
|
+
export type ConnectionState = boolean | typeof ModuleGraphConnection.TRANSITIVE_ONLY | typeof ModuleGraphConnection.CIRCULAR_CONNECTION;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RawHashedModuleIdsPluginOptions } from '@rspack/binding';
|
|
2
|
+
export declare const HashedModuleIdsPlugin: {
|
|
3
|
+
new (options?: RawHashedModuleIdsPluginOptions | undefined): {
|
|
4
|
+
name: string;
|
|
5
|
+
_args: [options?: RawHashedModuleIdsPluginOptions | undefined];
|
|
6
|
+
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
7
|
+
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
|
+
apply(compiler: import("../index.js").Compiler): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from './base.js';
|
|
3
|
+
export declare class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
|
|
4
|
+
private analyzeSideEffectsFree;
|
|
5
|
+
name: BuiltinPluginName;
|
|
6
|
+
affectedHooks: "compilation";
|
|
7
|
+
constructor(analyzeSideEffectsFree?: boolean);
|
|
8
|
+
raw(): BuiltinPlugin;
|
|
9
|
+
}
|
|
@@ -36,6 +36,7 @@ export * from './FetchCompileAsyncWasmPlugin.js';
|
|
|
36
36
|
export * from './FileUriPlugin.js';
|
|
37
37
|
export * from './FlagDependencyExportsPlugin.js';
|
|
38
38
|
export * from './FlagDependencyUsagePlugin.js';
|
|
39
|
+
export * from './HashedModuleIdsPlugin.js';
|
|
39
40
|
export * from './HotModuleReplacementPlugin.js';
|
|
40
41
|
export * from './HttpExternalsRspackPlugin.js';
|
|
41
42
|
export * from './HttpUriPlugin.js';
|
|
@@ -82,5 +83,4 @@ export * from './SplitChunksPlugin.js';
|
|
|
82
83
|
export * from './SubresourceIntegrityPlugin.js';
|
|
83
84
|
export * from './SwcJsMinimizerPlugin.js';
|
|
84
85
|
export * from './URLPlugin.js';
|
|
85
|
-
export * from './WebWorkerTemplatePlugin.js';
|
|
86
86
|
export * from './WorkerPlugin.js';
|
|
@@ -186,7 +186,7 @@ export interface LoaderContext<OptionsType = {}> {
|
|
|
186
186
|
*/
|
|
187
187
|
request: string;
|
|
188
188
|
/**
|
|
189
|
-
* An array of all the loaders. It is
|
|
189
|
+
* An array of all the loaders. It is writable in the pitch phase.
|
|
190
190
|
* loaders = [{request: string, path: string, query: string, module: function}]
|
|
191
191
|
*
|
|
192
192
|
* In the example:
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { ReadStream } from 'node:fs';
|
|
11
11
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
12
12
|
import type { ServerOptions } from 'node:https';
|
|
13
|
-
import type {
|
|
13
|
+
import type { NextFunction } from '../../compiled/connect-next/index.js';
|
|
14
14
|
import type { Filter as ProxyFilter, Options as ProxyOptions } from '../../compiled/http-proxy-middleware/index.js';
|
|
15
15
|
import type { Options as OpenOptions } from '../../compiled/open/index.js';
|
|
16
16
|
import type { Compiler, Configuration, LiteralUnion, MultiCompiler, MultiStats, Stats, Watching } from '../index.js';
|
|
@@ -153,7 +153,7 @@ export type DevServerClient = {
|
|
|
153
153
|
webSocketTransport?: LiteralUnion<'ws', string>;
|
|
154
154
|
webSocketURL?: string | DevServerWebSocketURL;
|
|
155
155
|
};
|
|
156
|
-
export type DevServerOptions<A extends BasicApplication =
|
|
156
|
+
export type DevServerOptions<A extends BasicApplication = BasicApplication, S extends BasicServer = BasicServer> = {
|
|
157
157
|
ipc?: string | boolean;
|
|
158
158
|
host?: DevServerHost;
|
|
159
159
|
port?: Port;
|
|
@@ -102,6 +102,7 @@ export interface ExperimentsNormalized {
|
|
|
102
102
|
useInputFileSystem?: false | RegExp[];
|
|
103
103
|
nativeWatcher?: boolean;
|
|
104
104
|
deferImport?: boolean;
|
|
105
|
+
pureFunctions?: boolean;
|
|
105
106
|
}
|
|
106
107
|
export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
|
|
107
108
|
export type OptimizationRuntimeChunkNormalized = false | {
|
|
@@ -137,7 +138,7 @@ export interface RspackOptionsNormalized {
|
|
|
137
138
|
incremental?: false | Incremental;
|
|
138
139
|
watch?: Watch;
|
|
139
140
|
watchOptions: WatchOptions;
|
|
140
|
-
devServer?: DevServer;
|
|
141
|
+
devServer?: false | DevServer;
|
|
141
142
|
ignoreWarnings?: IgnoreWarningsNormalized;
|
|
142
143
|
performance?: Performance;
|
|
143
144
|
amd?: Amd;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ export type EntryStatic = EntryObject | EntryUnnamed;
|
|
|
153
153
|
export type EntryDynamic = () => EntryStatic | Promise<EntryStatic>;
|
|
154
154
|
/** The entry options for building */
|
|
155
155
|
export type Entry = EntryStatic | EntryDynamic;
|
|
156
|
-
/** The output directory
|
|
156
|
+
/** The output directory. Relative paths are resolved against `context`. */
|
|
157
157
|
export type Path = string;
|
|
158
158
|
/** Tells Rspack to include comments in bundles with information about the contained modules. */
|
|
159
159
|
export type Pathinfo = boolean | 'verbose';
|
|
@@ -210,7 +210,7 @@ export type WorkerPublicPath = string;
|
|
|
210
210
|
/** Controls [Trusted Types](https://web.dev/articles/trusted-types) compatibility. */
|
|
211
211
|
export type TrustedTypes = {
|
|
212
212
|
/**
|
|
213
|
-
* The name of the Trusted Types policy created by
|
|
213
|
+
* The name of the Trusted Types policy created by Rspack to serve bundle chunks.
|
|
214
214
|
*/
|
|
215
215
|
policyName?: string;
|
|
216
216
|
/**
|
|
@@ -288,7 +288,7 @@ export type Environment = {
|
|
|
288
288
|
module?: boolean;
|
|
289
289
|
/**
|
|
290
290
|
* Determines if the node: prefix is generated for core module imports in environments that support it.
|
|
291
|
-
* This is only applicable to
|
|
291
|
+
* This is only applicable to Rspack runtime code.
|
|
292
292
|
* */
|
|
293
293
|
nodePrefixForCoreModules?: boolean;
|
|
294
294
|
/** The environment supports optional chaining ('obj?.a' or 'obj?.()'). */
|
|
@@ -298,7 +298,7 @@ export type Environment = {
|
|
|
298
298
|
};
|
|
299
299
|
export type Output = {
|
|
300
300
|
/**
|
|
301
|
-
* The output directory
|
|
301
|
+
* The output directory. Relative paths are resolved against `context`.
|
|
302
302
|
* @default path.resolve(process.cwd(), 'dist')
|
|
303
303
|
* */
|
|
304
304
|
path?: Path;
|
|
@@ -631,8 +631,30 @@ export type RuleSetLoaderWithOptions = {
|
|
|
631
631
|
};
|
|
632
632
|
export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
|
|
633
633
|
export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem[]);
|
|
634
|
+
export type RuleSetRuleUseAndLoader = {
|
|
635
|
+
/** A loader name */
|
|
636
|
+
loader: RuleSetLoader;
|
|
637
|
+
/** A loader options */
|
|
638
|
+
options?: RuleSetLoaderOptions;
|
|
639
|
+
/** An array to pass the Loader package name and its options. */
|
|
640
|
+
use?: never;
|
|
641
|
+
} | {
|
|
642
|
+
/** A loader name */
|
|
643
|
+
loader?: never;
|
|
644
|
+
/** A loader options */
|
|
645
|
+
options?: never;
|
|
646
|
+
/** An array to pass the Loader package name and its options. */
|
|
647
|
+
use: RuleSetUse;
|
|
648
|
+
} | {
|
|
649
|
+
/** A loader name */
|
|
650
|
+
loader?: never;
|
|
651
|
+
/** A loader options */
|
|
652
|
+
options?: never;
|
|
653
|
+
/** An array to pass the Loader package name and its options. */
|
|
654
|
+
use?: never;
|
|
655
|
+
};
|
|
634
656
|
/** Rule defines the conditions for matching a module and the behavior of handling those modules. */
|
|
635
|
-
export type RuleSetRule = {
|
|
657
|
+
export type RuleSetRule = RuleSetRuleUseAndLoader & {
|
|
636
658
|
/** Matches all modules that match this resource, and will match against Resource. */
|
|
637
659
|
test?: RuleSetCondition;
|
|
638
660
|
/** Excludes all modules that match this condition and will match against the absolute path of the resource */
|
|
@@ -663,12 +685,6 @@ export type RuleSetRule = {
|
|
|
663
685
|
type?: string;
|
|
664
686
|
/** Used to mark the layer of the matching module. */
|
|
665
687
|
layer?: string;
|
|
666
|
-
/** A loader name */
|
|
667
|
-
loader?: RuleSetLoader;
|
|
668
|
-
/** A loader options */
|
|
669
|
-
options?: RuleSetLoaderOptions;
|
|
670
|
-
/** An array to pass the Loader package name and its options. */
|
|
671
|
-
use?: RuleSetUse;
|
|
672
688
|
/**
|
|
673
689
|
* Parser options for the specific modules that matched by the rule conditions
|
|
674
690
|
* It will override the parser options in module.parser.
|
|
@@ -807,7 +823,6 @@ export type JavascriptParserOptions = {
|
|
|
807
823
|
dynamicImportFetchPriority?: 'low' | 'high' | 'auto';
|
|
808
824
|
/**
|
|
809
825
|
* Enable or disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
|
|
810
|
-
* @default 'preserve-unknown'
|
|
811
826
|
*/
|
|
812
827
|
importMeta?: boolean | 'preserve-unknown';
|
|
813
828
|
/**
|
|
@@ -898,6 +913,11 @@ export type JavascriptParserOptions = {
|
|
|
898
913
|
* @default false
|
|
899
914
|
*/
|
|
900
915
|
importMetaResolve?: boolean;
|
|
916
|
+
/**
|
|
917
|
+
* Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
|
|
918
|
+
* @experimental
|
|
919
|
+
*/
|
|
920
|
+
pureFunctions?: string[];
|
|
901
921
|
};
|
|
902
922
|
export type JsonParserOptions = {
|
|
903
923
|
/**
|
|
@@ -1354,6 +1374,8 @@ export type MemoryCacheOptions = {
|
|
|
1354
1374
|
*/
|
|
1355
1375
|
export type CacheOptions = boolean | MemoryCacheOptions | PersistentCacheOptions;
|
|
1356
1376
|
export type StatsPresets = 'normal' | 'none' | 'verbose' | 'errors-only' | 'errors-warnings' | 'minimal' | 'detailed' | 'summary';
|
|
1377
|
+
type AssetFilterItemTypes = RegExp | string | ((name: string, asset: any) => boolean);
|
|
1378
|
+
type AssetFilterTypes = boolean | AssetFilterItemTypes | AssetFilterItemTypes[];
|
|
1357
1379
|
type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
|
|
1358
1380
|
type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
|
|
1359
1381
|
export type StatsColorOptions = {
|
|
@@ -1638,7 +1660,7 @@ export type StatsOptions = {
|
|
|
1638
1660
|
* Exclude the matching assets information.
|
|
1639
1661
|
* @default false
|
|
1640
1662
|
*/
|
|
1641
|
-
excludeAssets?:
|
|
1663
|
+
excludeAssets?: AssetFilterTypes;
|
|
1642
1664
|
/**
|
|
1643
1665
|
* Specifies the sorting order for modules.
|
|
1644
1666
|
* @default 'id'
|
|
@@ -1818,6 +1840,13 @@ type SharedOptimizationSplitChunksCacheGroup = {
|
|
|
1818
1840
|
*/
|
|
1819
1841
|
minSize?: OptimizationSplitChunksSizes;
|
|
1820
1842
|
minSizeReduction?: OptimizationSplitChunksSizes;
|
|
1843
|
+
/**
|
|
1844
|
+
* Size threshold at which splitting is enforced and other restrictions
|
|
1845
|
+
* (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
|
|
1846
|
+
* The value is `50000` in production mode.
|
|
1847
|
+
* The value is `30000` in others mode.
|
|
1848
|
+
*/
|
|
1849
|
+
enforceSizeThreshold?: OptimizationSplitChunksSizes;
|
|
1821
1850
|
/** Maximum size, in bytes, for a chunk to be generated. */
|
|
1822
1851
|
maxSize?: OptimizationSplitChunksSizes;
|
|
1823
1852
|
/** Maximum size, in bytes, for a async chunk to be generated. */
|
|
@@ -1900,8 +1929,10 @@ export type OptimizationSplitChunksOptions = {
|
|
|
1900
1929
|
export type Optimization = {
|
|
1901
1930
|
/**
|
|
1902
1931
|
* Which algorithm to use when choosing module ids.
|
|
1932
|
+
* Setting to `false` disables the built-in algorithm, allowing a custom plugin
|
|
1933
|
+
* (e.g. HashedModuleIdsPlugin) to provide module ids instead.
|
|
1903
1934
|
*/
|
|
1904
|
-
moduleIds?: 'named' | 'natural' | 'deterministic';
|
|
1935
|
+
moduleIds?: false | 'named' | 'natural' | 'deterministic' | 'hashed';
|
|
1905
1936
|
/**
|
|
1906
1937
|
* Which algorithm to use when choosing chunk ids.
|
|
1907
1938
|
*/
|
|
@@ -2199,19 +2230,24 @@ export type Experiments = {
|
|
|
2199
2230
|
* @default false
|
|
2200
2231
|
*/
|
|
2201
2232
|
deferImport?: boolean;
|
|
2233
|
+
/**
|
|
2234
|
+
* Enable pure-function-based side-effects analysis.
|
|
2235
|
+
* @default false
|
|
2236
|
+
*/
|
|
2237
|
+
pureFunctions?: boolean;
|
|
2202
2238
|
};
|
|
2203
2239
|
export type Watch = boolean;
|
|
2204
2240
|
/** Options for watch mode. */
|
|
2205
2241
|
export type WatchOptions = {
|
|
2206
2242
|
/**
|
|
2207
2243
|
* Add a delay before rebuilding once the first file changed.
|
|
2208
|
-
* This allows
|
|
2244
|
+
* This allows Rspack to aggregate any other changes made during this time period into one rebuild.
|
|
2209
2245
|
* @default 5
|
|
2210
2246
|
*/
|
|
2211
2247
|
aggregateTimeout?: number;
|
|
2212
2248
|
/**
|
|
2213
2249
|
* Follow symlinks while looking for files.
|
|
2214
|
-
* This is usually not needed as
|
|
2250
|
+
* This is usually not needed as Rspack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
|
|
2215
2251
|
*/
|
|
2216
2252
|
followSymlinks?: boolean;
|
|
2217
2253
|
/**
|
|
@@ -2270,13 +2306,13 @@ export type Performance = false | {
|
|
|
2270
2306
|
*/
|
|
2271
2307
|
hints?: false | 'warning' | 'error';
|
|
2272
2308
|
/**
|
|
2273
|
-
* File size limit (in bytes) when exceeded,
|
|
2274
|
-
* @default
|
|
2309
|
+
* File size limit (in bytes) when exceeded, Rspack will provide performance hints.
|
|
2310
|
+
* @default 307200 (300 KiB)
|
|
2275
2311
|
*/
|
|
2276
2312
|
maxAssetSize?: number;
|
|
2277
2313
|
/**
|
|
2278
2314
|
* Total size of an entry point (in bytes).
|
|
2279
|
-
* @default
|
|
2315
|
+
* @default 512000 (500 KiB)
|
|
2280
2316
|
*/
|
|
2281
2317
|
maxEntrypointSize?: number;
|
|
2282
2318
|
};
|
|
@@ -2400,7 +2436,7 @@ export type RspackOptions = {
|
|
|
2400
2436
|
/**
|
|
2401
2437
|
* Configuration for the development server.
|
|
2402
2438
|
*/
|
|
2403
|
-
devServer?: DevServer;
|
|
2439
|
+
devServer?: false | DevServer;
|
|
2404
2440
|
/**
|
|
2405
2441
|
* Options for module configuration.
|
|
2406
2442
|
*/
|
package/dist/exports.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { ExternalModule } from './ExternalModule.js';
|
|
|
16
16
|
export type { ResolveData, ResourceDataWithData } from './Module.js';
|
|
17
17
|
export { Module } from './Module.js';
|
|
18
18
|
export type { default as ModuleGraph } from './ModuleGraph.js';
|
|
19
|
+
export { ModuleGraphConnection, type ConnectionState, } from './ModuleGraphConnection.js';
|
|
19
20
|
export { MultiStats } from './MultiStats.js';
|
|
20
21
|
export { NormalModule } from './NormalModule.js';
|
|
21
22
|
export type { NormalModuleFactory } from './NormalModuleFactory.js';
|
|
@@ -56,9 +57,11 @@ export { LoaderOptionsPlugin } from './lib/LoaderOptionsPlugin.js';
|
|
|
56
57
|
export { LoaderTargetPlugin } from './lib/LoaderTargetPlugin.js';
|
|
57
58
|
export type { OutputFileSystem, WatchFileSystem } from './util/fs.js';
|
|
58
59
|
import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, rsc, SubresourceIntegrityPlugin } from './builtin-plugin/index.js';
|
|
60
|
+
import JsonpTemplatePlugin from './web/JsonpTemplatePlugin.js';
|
|
59
61
|
export { SubresourceIntegrityPlugin };
|
|
60
62
|
interface Web {
|
|
61
63
|
FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
|
|
64
|
+
JsonpTemplatePlugin: typeof JsonpTemplatePlugin;
|
|
62
65
|
}
|
|
63
66
|
export declare const web: Web;
|
|
64
67
|
import { NodeTargetPlugin } from './builtin-plugin/index.js';
|
|
@@ -76,6 +79,11 @@ interface Electron {
|
|
|
76
79
|
ElectronTargetPlugin: typeof ElectronTargetPlugin;
|
|
77
80
|
}
|
|
78
81
|
export declare const electron: Electron;
|
|
82
|
+
import { HashedModuleIdsPlugin } from './builtin-plugin/index.js';
|
|
83
|
+
interface Ids {
|
|
84
|
+
HashedModuleIdsPlugin: typeof HashedModuleIdsPlugin;
|
|
85
|
+
}
|
|
86
|
+
export declare const ids: Ids;
|
|
79
87
|
import { EnableLibraryPlugin } from './builtin-plugin/index.js';
|
|
80
88
|
interface Library {
|
|
81
89
|
EnableLibraryPlugin: typeof EnableLibraryPlugin;
|
|
@@ -92,7 +100,7 @@ interface JavaScript {
|
|
|
92
100
|
JavascriptModulesPlugin: typeof JavascriptModulesPlugin;
|
|
93
101
|
}
|
|
94
102
|
export declare const javascript: JavaScript;
|
|
95
|
-
import
|
|
103
|
+
import WebWorkerTemplatePlugin from './webworker/WebWorkerTemplatePlugin.js';
|
|
96
104
|
interface Webworker {
|
|
97
105
|
WebWorkerTemplatePlugin: typeof WebWorkerTemplatePlugin;
|
|
98
106
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let createMd4, createXxhash64, service_pool, loadLoader_url;
|
|
1
|
+
let _computedKey, _computedKey1, _computedKey2, createMd4, createXxhash64, service_pool, loadLoader_url, ArrayQueue_computedKey;
|
|
2
2
|
import node_util, { inspect, promisify } from "node:util";
|
|
3
3
|
import { createRequire, createRequire as __rspack_createRequire } from "node:module";
|
|
4
4
|
import node_path, { isAbsolute, join, relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
@@ -6,7 +6,7 @@ import node_querystring from "node:querystring";
|
|
|
6
6
|
import node_fs, { readFileSync } from "node:fs";
|
|
7
7
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
8
8
|
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
9
|
-
var RuntimeGlobals,
|
|
9
|
+
var RuntimeGlobals, key, StatsErrorCode, __webpack_modules__ = {}, __webpack_module_cache__ = {};
|
|
10
10
|
function __webpack_require__(moduleId) {
|
|
11
11
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
12
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
@@ -281,6 +281,7 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
281
281
|
LoaderTargetPlugin: ()=>LoaderTargetPlugin,
|
|
282
282
|
Module: ()=>binding_namespaceObject.Module,
|
|
283
283
|
ModuleFilenameHelpers: ()=>ModuleFilenameHelpers_namespaceObject,
|
|
284
|
+
ModuleGraphConnection: ()=>ModuleGraphConnection,
|
|
284
285
|
MultiCompiler: ()=>MultiCompiler,
|
|
285
286
|
MultiStats: ()=>MultiStats,
|
|
286
287
|
NoEmitOnErrorsPlugin: ()=>NoEmitOnErrorsPlugin,
|
|
@@ -305,6 +306,7 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
305
306
|
container: ()=>container,
|
|
306
307
|
electron: ()=>electron,
|
|
307
308
|
experiments: ()=>exports_experiments,
|
|
309
|
+
ids: ()=>exports_ids,
|
|
308
310
|
javascript: ()=>javascript,
|
|
309
311
|
lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
|
|
310
312
|
library: ()=>exports_library,
|
|
@@ -1830,10 +1832,26 @@ function createDiagnosticArray(adm) {
|
|
|
1830
1832
|
});
|
|
1831
1833
|
return adm[$proxy] = proxy, proxy;
|
|
1832
1834
|
}
|
|
1835
|
+
function _to_property_key(arg) {
|
|
1836
|
+
var key = function(input, hint) {
|
|
1837
|
+
if ("object" !== _type_of(input) || null === input) return input;
|
|
1838
|
+
var prim = input[Symbol.toPrimitive];
|
|
1839
|
+
if (void 0 !== prim) {
|
|
1840
|
+
var res = prim.call(input, hint || "default");
|
|
1841
|
+
if ("object" !== _type_of(res)) return res;
|
|
1842
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
1843
|
+
}
|
|
1844
|
+
return ("string" === hint ? String : Number)(input);
|
|
1845
|
+
}(arg, "string");
|
|
1846
|
+
return "symbol" === _type_of(key) ? key : String(key);
|
|
1847
|
+
}
|
|
1848
|
+
function _type_of(obj) {
|
|
1849
|
+
return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1850
|
+
}
|
|
1833
1851
|
let checkCompilation = (compilation)=>{
|
|
1834
1852
|
if (!(compilation instanceof Compilation)) throw TypeError('The \'compilation\' argument must be an instance of Compilation. This usually occurs when multiple versions of "@rspack/core" are used, or when the code in "@rspack/core" is executed multiple times.');
|
|
1835
1853
|
};
|
|
1836
|
-
_computedKey = binding_default().COMPILATION_HOOKS_MAP_SYMBOL;
|
|
1854
|
+
_computedKey = _to_property_key(binding_default().COMPILATION_HOOKS_MAP_SYMBOL);
|
|
1837
1855
|
class Compilation {
|
|
1838
1856
|
#inner;
|
|
1839
1857
|
#shutdown;
|
|
@@ -2349,7 +2367,7 @@ class EntryData {
|
|
|
2349
2367
|
this.dependencies = binding.dependencies, this.includeDependencies = binding.includeDependencies, this.options = binding.options;
|
|
2350
2368
|
}
|
|
2351
2369
|
}
|
|
2352
|
-
_computedKey1 = Symbol.iterator, _computedKey2 = Symbol.toStringTag;
|
|
2370
|
+
_computedKey1 = _to_property_key(Symbol.iterator), _computedKey2 = _to_property_key(Symbol.toStringTag);
|
|
2353
2371
|
class Entries {
|
|
2354
2372
|
#data;
|
|
2355
2373
|
constructor(data){
|
|
@@ -2458,7 +2476,7 @@ let INTERNAL_PLUGIN_NAMES = Object.keys(binding_default().BuiltinPluginName), AP
|
|
|
2458
2476
|
}), BundlerInfoRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.BundlerInfoRspackPlugin, (options)=>({
|
|
2459
2477
|
version: options.version || 'unknown',
|
|
2460
2478
|
bundler: options.bundler || 'rspack',
|
|
2461
|
-
force: options.force ?? !
|
|
2479
|
+
force: options.force ?? !1
|
|
2462
2480
|
})), CaseSensitivePlugin = base_create(binding_namespaceObject.BuiltinPluginName.CaseSensitivePlugin, ()=>{}, 'compilation'), ChunkPrefetchPreloadPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
|
|
2463
2481
|
class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
2464
2482
|
name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
|
|
@@ -2716,7 +2734,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2716
2734
|
function getChunks(chunks) {
|
|
2717
2735
|
return 'function' == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
|
2718
2736
|
}
|
|
2719
|
-
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
2737
|
+
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
2720
2738
|
return {
|
|
2721
2739
|
name: getName(name),
|
|
2722
2740
|
chunks: getChunks(chunks),
|
|
@@ -2725,7 +2743,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2725
2743
|
'unknown'
|
|
2726
2744
|
],
|
|
2727
2745
|
cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>!1 !== group).map(([key, group])=>{
|
|
2728
|
-
let { test, name, chunks, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
2746
|
+
let { test, name, chunks, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
2729
2747
|
return {
|
|
2730
2748
|
key,
|
|
2731
2749
|
test: 'function' == typeof test ? (ctx)=>{
|
|
@@ -2739,6 +2757,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2739
2757
|
chunks: getChunks(chunks),
|
|
2740
2758
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2741
2759
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2760
|
+
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
2742
2761
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2743
2762
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2744
2763
|
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
@@ -2751,6 +2770,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2751
2770
|
},
|
|
2752
2771
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2753
2772
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2773
|
+
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
2754
2774
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2755
2775
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2756
2776
|
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
@@ -4299,19 +4319,16 @@ function tryMatch(payload, condition) {
|
|
|
4299
4319
|
return !1;
|
|
4300
4320
|
}
|
|
4301
4321
|
let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
4302
|
-
let funcUse
|
|
4303
|
-
if (rule.loader && (rule.use = [
|
|
4322
|
+
let funcUse, normalizedUse = rule.loader ? [
|
|
4304
4323
|
{
|
|
4305
4324
|
loader: rule.loader,
|
|
4306
4325
|
options: rule.options
|
|
4307
4326
|
}
|
|
4308
|
-
]
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
}) ?? [], `${path}.use`, options);
|
|
4314
|
-
}
|
|
4327
|
+
] : rule.use;
|
|
4328
|
+
'function' == typeof normalizedUse && (funcUse = (rawContext)=>createRawModuleRuleUses(normalizedUse({
|
|
4329
|
+
...rawContext,
|
|
4330
|
+
compiler: options.compiler
|
|
4331
|
+
}) ?? [], `${path}.use`, options));
|
|
4315
4332
|
let rawModuleRule = {
|
|
4316
4333
|
test: rule.test ? getRawRuleSetCondition(rule.test) : void 0,
|
|
4317
4334
|
include: rule.include ? getRawRuleSetCondition(rule.include) : void 0,
|
|
@@ -4333,7 +4350,7 @@ let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
|
4333
4350
|
scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
|
|
4334
4351
|
mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
|
|
4335
4352
|
sideEffects: rule.sideEffects,
|
|
4336
|
-
use: 'function' == typeof
|
|
4353
|
+
use: 'function' == typeof normalizedUse ? funcUse : createRawModuleRuleUses(normalizedUse ?? [], `${path}.use`, options),
|
|
4337
4354
|
type: rule.type,
|
|
4338
4355
|
layer: rule.layer,
|
|
4339
4356
|
parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
|
|
@@ -4468,7 +4485,8 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
4468
4485
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
4469
4486
|
jsx: parser.jsx,
|
|
4470
4487
|
deferImport: parser.deferImport,
|
|
4471
|
-
importMetaResolve: parser.importMetaResolve
|
|
4488
|
+
importMetaResolve: parser.importMetaResolve,
|
|
4489
|
+
pureFunctions: parser.pureFunctions
|
|
4472
4490
|
};
|
|
4473
4491
|
}
|
|
4474
4492
|
function getRawCssParserOptions(parser) {
|
|
@@ -4666,6 +4684,9 @@ class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
|
|
4666
4684
|
return createBuiltinPlugin(this.name, this.global);
|
|
4667
4685
|
}
|
|
4668
4686
|
}
|
|
4687
|
+
let HashedModuleIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HashedModuleIdsPlugin, (options)=>({
|
|
4688
|
+
...options
|
|
4689
|
+
}), 'compilation');
|
|
4669
4690
|
class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
|
|
4670
4691
|
name = binding_namespaceObject.BuiltinPluginName.HotModuleReplacementPlugin;
|
|
4671
4692
|
raw(compiler) {
|
|
@@ -5176,7 +5197,18 @@ class RscServerPlugin extends RspackBuiltinPlugin {
|
|
|
5176
5197
|
});
|
|
5177
5198
|
}
|
|
5178
5199
|
}
|
|
5179
|
-
|
|
5200
|
+
class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
|
|
5201
|
+
analyzeSideEffectsFree;
|
|
5202
|
+
name = binding_namespaceObject.BuiltinPluginName.SideEffectsFlagPlugin;
|
|
5203
|
+
affectedHooks = 'compilation';
|
|
5204
|
+
constructor(analyzeSideEffectsFree = !1){
|
|
5205
|
+
super(), this.analyzeSideEffectsFree = analyzeSideEffectsFree;
|
|
5206
|
+
}
|
|
5207
|
+
raw() {
|
|
5208
|
+
return createBuiltinPlugin(this.name, this.analyzeSideEffectsFree);
|
|
5209
|
+
}
|
|
5210
|
+
}
|
|
5211
|
+
let SizeLimitsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
|
5180
5212
|
let hints = !1 === options.hints ? void 0 : options.hints;
|
|
5181
5213
|
return {
|
|
5182
5214
|
...options,
|
|
@@ -5365,12 +5397,6 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
|
|
|
5365
5397
|
}
|
|
5366
5398
|
};
|
|
5367
5399
|
}, 'compilation'), URLPlugin = base_create(binding_namespaceObject.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
5368
|
-
class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
5369
|
-
name = binding_namespaceObject.BuiltinPluginName.WebWorkerTemplatePlugin;
|
|
5370
|
-
raw(compiler) {
|
|
5371
|
-
return compiler.options.output.chunkLoading = "import-scripts", createBuiltinPlugin(this.name, void 0);
|
|
5372
|
-
}
|
|
5373
|
-
}
|
|
5374
5400
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
5375
5401
|
chunkLoading;
|
|
5376
5402
|
wasmLoading;
|
|
@@ -5519,7 +5545,7 @@ let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(
|
|
|
5519
5545
|
}, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf('...') ? 2 : 1 : 'object' != typeof value || null === value || value.constructor && value.constructor !== Object ? 1 : 3, cleverMerge = (first, second)=>void 0 === second ? first : void 0 === first || 'object' != typeof second || null === second ? second : 'object' != typeof first || null === first ? first : _cleverMerge(first, second, !1), _cleverMerge = (first, second, internalCaching = !1)=>{
|
|
5520
5546
|
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
5521
5547
|
if (void 0 !== firstDynamicInfo) {
|
|
5522
|
-
let {
|
|
5548
|
+
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
5523
5549
|
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
5524
5550
|
let newFn = (...args)=>{
|
|
5525
5551
|
let fnResult = fn(...args);
|
|
@@ -6551,7 +6577,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6551
6577
|
targets: targetProperties.targets
|
|
6552
6578
|
};
|
|
6553
6579
|
}, applyExperimentsDefaults = (experiments)=>{
|
|
6554
|
-
D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1);
|
|
6580
|
+
D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', !1);
|
|
6555
6581
|
}, applyIncrementalDefaults = (options)=>{
|
|
6556
6582
|
D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
|
|
6557
6583
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
|
|
@@ -6763,7 +6789,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6763
6789
|
return 'function' != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, '.css$1') : '[id].css';
|
|
6764
6790
|
}), D(output, 'hotUpdateChunkFilename', `[id].[fullhash].hot-update.${output.module ? 'mjs' : 'js'}`), F(output, 'hotUpdateMainFilename', ()=>`[runtime].[fullhash].hot-update.${output.module ? 'json.mjs' : 'json'}`);
|
|
6765
6791
|
let uniqueNameId = Template.toIdentifier(output.uniqueName);
|
|
6766
|
-
F(output, 'hotUpdateGlobal', ()=>`rspackHotUpdate${uniqueNameId}`), F(output, 'chunkLoadingGlobal', ()=>`rspackChunk${uniqueNameId}`), D(output, 'assetModuleFilename', '[hash][ext][query]'), D(output, 'webassemblyModuleFilename', '[hash].module.wasm'), D(output, 'compareBeforeEmit', !0),
|
|
6792
|
+
if (F(output, 'hotUpdateGlobal', ()=>`rspackHotUpdate${uniqueNameId}`), F(output, 'chunkLoadingGlobal', ()=>`rspackChunk${uniqueNameId}`), D(output, 'assetModuleFilename', '[hash][ext][query]'), D(output, 'webassemblyModuleFilename', '[hash].module.wasm'), D(output, 'compareBeforeEmit', !0), output.path && !node_path.isAbsolute(output.path)) {
|
|
6793
|
+
if (!context) throw Error(`Invalid Rspack configuration: "context" must be a non-empty absolute path when "output.path" is relative, get "${context ?? ''}".`);
|
|
6794
|
+
output.path = node_path.resolve(context, output.path);
|
|
6795
|
+
}
|
|
6796
|
+
F(output, 'path', ()=>node_path.join(process.cwd(), 'dist')), F(output, 'pathinfo', ()=>!1), D(output, 'publicPath', tp && (tp.document || tp.importScripts) ? 'auto' : ''), D(output, 'hashFunction', 'xxhash64'), D(output, 'hashDigest', 'hex'), D(output, 'hashDigestLength', 16), D(output, 'strictModuleErrorHandling', !1), F(output, 'chunkFormat', ()=>{
|
|
6767
6797
|
if (tp) {
|
|
6768
6798
|
let helpMessage = isAffectedByBrowserslist ? "Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly." : "Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.";
|
|
6769
6799
|
if (output.module) {
|
|
@@ -6835,7 +6865,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6835
6865
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6836
6866
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6837
6867
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6838
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-rc.
|
|
6868
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-rc.3"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
|
|
6839
6869
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6840
6870
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6841
6871
|
D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
|
|
@@ -6851,7 +6881,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6851
6881
|
}, applyNodeDefaults = (node, { outputModule, targetProperties })=>{
|
|
6852
6882
|
!1 !== node && (F(node, 'global', ()=>(!targetProperties || !targetProperties.global) && 'warn'), F(node, '__dirname', ()=>targetProperties && targetProperties.node ? outputModule ? 'node-module' : 'eval-only' : 'warn-mock'), F(node, '__filename', ()=>targetProperties && targetProperties.node ? outputModule ? 'node-module' : 'eval-only' : 'warn-mock'));
|
|
6853
6883
|
}, applyPerformanceDefaults = (performance, { production })=>{
|
|
6854
|
-
!1 !== performance && (D(performance, 'maxAssetSize',
|
|
6884
|
+
!1 !== performance && (D(performance, 'maxAssetSize', 307200), D(performance, 'maxEntrypointSize', 512000), F(performance, 'hints', ()=>!!production && 'warning'));
|
|
6855
6885
|
}, applyOptimizationDefaults = (optimization, { production, development })=>{
|
|
6856
6886
|
D(optimization, 'removeEmptyChunks', !0), D(optimization, 'mergeDuplicateChunks', !0), F(optimization, 'moduleIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'chunkIds', ()=>production ? 'deterministic' : development ? 'named' : 'natural'), F(optimization, 'sideEffects', ()=>!!production || 'flag'), D(optimization, 'mangleExports', production), D(optimization, 'inlineExports', production), D(optimization, 'providedExports', !0), D(optimization, 'usedExports', production), D(optimization, 'innerGraph', production), D(optimization, 'emitOnErrors', !production), D(optimization, 'runtimeChunk', !1), D(optimization, 'realContentHash', production), D(optimization, 'avoidEntryIife', !1), D(optimization, 'minimize', production), D(optimization, 'concatenateModules', production), A(optimization, 'minimizer', ()=>[
|
|
6857
6887
|
new SwcJsMinimizerRspackPlugin(),
|
|
@@ -6863,7 +6893,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6863
6893
|
"javascript",
|
|
6864
6894
|
'css',
|
|
6865
6895
|
'unknown'
|
|
6866
|
-
]), D(splitChunks, 'hidePathInfo', production), D(splitChunks, 'chunks', 'async'), D(splitChunks, 'usedExports', !0 === optimization.usedExports), D(splitChunks, 'minChunks', 1), F(splitChunks, 'minSize', ()=>production ? 20000 : 10000), F(splitChunks, 'maxAsyncRequests', ()=>production ? 30 : 1 / 0), F(splitChunks, 'maxInitialRequests', ()=>production ? 30 : 1 / 0), D(splitChunks, 'automaticNameDelimiter', '-');
|
|
6896
|
+
]), D(splitChunks, 'hidePathInfo', production), D(splitChunks, 'chunks', 'async'), D(splitChunks, 'usedExports', !0 === optimization.usedExports), D(splitChunks, 'minChunks', 1), F(splitChunks, 'minSize', ()=>production ? 20000 : 10000), F(splitChunks, 'enforceSizeThreshold', ()=>production ? 50000 : 30000), F(splitChunks, 'maxAsyncRequests', ()=>production ? 30 : 1 / 0), F(splitChunks, 'maxInitialRequests', ()=>production ? 30 : 1 / 0), D(splitChunks, 'automaticNameDelimiter', '-');
|
|
6867
6897
|
let { cacheGroups } = splitChunks;
|
|
6868
6898
|
cacheGroups && (F(cacheGroups, 'default', ()=>({
|
|
6869
6899
|
idHint: '',
|
|
@@ -8089,7 +8119,7 @@ class MultiStats {
|
|
|
8089
8119
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8090
8120
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8091
8121
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8092
|
-
}), childOptions.version && (obj.rspackVersion = "2.0.0-rc.
|
|
8122
|
+
}), childOptions.version && (obj.rspackVersion = "2.0.0-rc.3", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8093
8123
|
let mapError = (j, obj)=>({
|
|
8094
8124
|
...obj,
|
|
8095
8125
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8164,7 +8194,19 @@ let asyncLib_each = function(collection, iterator, originalCallback) {
|
|
|
8164
8194
|
for (let watching of this.watchings)watching.resume();
|
|
8165
8195
|
}
|
|
8166
8196
|
};
|
|
8167
|
-
|
|
8197
|
+
function ArrayQueue_type_of(obj) {
|
|
8198
|
+
return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8199
|
+
}
|
|
8200
|
+
key = function(input, hint) {
|
|
8201
|
+
if ("object" !== ArrayQueue_type_of(input) || null === input) return input;
|
|
8202
|
+
var prim = input[Symbol.toPrimitive];
|
|
8203
|
+
if (void 0 !== prim) {
|
|
8204
|
+
var res = prim.call(input, hint || "default");
|
|
8205
|
+
if ("object" !== ArrayQueue_type_of(res)) return res;
|
|
8206
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
8207
|
+
}
|
|
8208
|
+
return ("string" === hint ? String : Number)(input);
|
|
8209
|
+
}(Symbol.iterator, "string"), ArrayQueue_computedKey = "symbol" === ArrayQueue_type_of(key) ? key : String(key);
|
|
8168
8210
|
let util_ArrayQueue = class {
|
|
8169
8211
|
_list;
|
|
8170
8212
|
_listReversed;
|
|
@@ -9348,7 +9390,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9348
9390
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9349
9391
|
},
|
|
9350
9392
|
version: (object)=>{
|
|
9351
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.0-rc.
|
|
9393
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.0-rc.3";
|
|
9352
9394
|
},
|
|
9353
9395
|
env: (object, _compilation, _context, { _env })=>{
|
|
9354
9396
|
object.env = _env;
|
|
@@ -10610,7 +10652,7 @@ class RspackOptionsApply {
|
|
|
10610
10652
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
10611
10653
|
namespace: options.output.devtoolNamespace
|
|
10612
10654
|
}).apply(compiler);
|
|
10613
|
-
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin().apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10655
|
+
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10614
10656
|
let enableLibSplitChunks = !1;
|
|
10615
10657
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
|
10616
10658
|
let hasModernModule = options.output.enabledLibraryTypes.includes('modern-module'), hasNonModernModule = options.output.enabledLibraryTypes.some((t)=>'modern-module' !== t);
|
|
@@ -10628,6 +10670,9 @@ class RspackOptionsApply {
|
|
|
10628
10670
|
case 'deterministic':
|
|
10629
10671
|
new DeterministicModuleIdsPlugin().apply(compiler);
|
|
10630
10672
|
break;
|
|
10673
|
+
case 'hashed':
|
|
10674
|
+
new HashedModuleIdsPlugin().apply(compiler);
|
|
10675
|
+
break;
|
|
10631
10676
|
default:
|
|
10632
10677
|
throw Error(`moduleIds: ${moduleIds} is not implemented`);
|
|
10633
10678
|
}
|
|
@@ -10664,16 +10709,14 @@ class RspackOptionsApply {
|
|
|
10664
10709
|
compiler.hooks.afterResolvers.call(compiler);
|
|
10665
10710
|
}
|
|
10666
10711
|
}
|
|
10667
|
-
let
|
|
10712
|
+
let validateConfig_ERROR_PREFIX = 'Invalid Rspack configuration:';
|
|
10668
10713
|
function validateRspackConfig(config) {
|
|
10669
10714
|
(({ context })=>{
|
|
10670
|
-
if (context && !isAbsolute(context)) throw Error(`${
|
|
10671
|
-
})(config), (({ output })=>{
|
|
10672
|
-
if (output?.path && !isAbsolute(output.path)) throw Error(`${ERROR_PREFIX} "output.path" must be an absolute path, get "${output.path}".`);
|
|
10715
|
+
if (context && !isAbsolute(context)) throw Error(`${validateConfig_ERROR_PREFIX} "context" must be an absolute path, get "${context}".`);
|
|
10673
10716
|
})(config), (({ optimization })=>{
|
|
10674
10717
|
if (optimization?.splitChunks) {
|
|
10675
10718
|
let { minChunks } = optimization.splitChunks;
|
|
10676
|
-
if (void 0 !== minChunks && minChunks < 1) throw Error(`${
|
|
10719
|
+
if (void 0 !== minChunks && minChunks < 1) throw Error(`${validateConfig_ERROR_PREFIX} "optimization.splitChunks.minChunks" must be greater than or equal to 1, get \`${minChunks}\`.`);
|
|
10677
10720
|
}
|
|
10678
10721
|
})(config), (({ output, externals, externalsType })=>{
|
|
10679
10722
|
let library = output?.library;
|
|
@@ -10686,7 +10729,7 @@ function validateRspackConfig(config) {
|
|
|
10686
10729
|
'commonjs',
|
|
10687
10730
|
'commonjs2',
|
|
10688
10731
|
'amd'
|
|
10689
|
-
].some((key)=>void 0 === value[key])) throw Error(`${
|
|
10732
|
+
].some((key)=>void 0 === value[key])) throw Error(`${validateConfig_ERROR_PREFIX} External object must have "root", "commonjs", "commonjs2", "amd" properties when "libraryType" or "externalsType" is "umd", get: ${JSON.stringify(value, null, 2)}.`);
|
|
10690
10733
|
};
|
|
10691
10734
|
Array.isArray(externals) ? externals.forEach((external)=>checkExternalItem(external)) : checkExternalItem(externals);
|
|
10692
10735
|
})(config);
|
|
@@ -11005,7 +11048,7 @@ class TraceHookPlugin {
|
|
|
11005
11048
|
});
|
|
11006
11049
|
}
|
|
11007
11050
|
}
|
|
11008
|
-
let CORE_VERSION = "2.0.0-rc.
|
|
11051
|
+
let CORE_VERSION = "2.0.0-rc.3", VFILES_BY_COMPILER = new WeakMap();
|
|
11009
11052
|
class VirtualModulesPlugin {
|
|
11010
11053
|
#staticModules;
|
|
11011
11054
|
#compiler;
|
|
@@ -11342,7 +11385,7 @@ class Compiler {
|
|
|
11342
11385
|
electron: null
|
|
11343
11386
|
}, this.#target = {}, this.__internal_browser_require = ()=>{
|
|
11344
11387
|
throw Error('Cannot execute user defined code in browser without `BrowserRequirePlugin`');
|
|
11345
|
-
}, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this), Object.defineProperty(this, GET_COMPILER_ID, {
|
|
11388
|
+
}, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), 'on' === JavaScriptTracer.state && new TraceHookPlugin().apply(this), Object.defineProperty(this, GET_COMPILER_ID, {
|
|
11346
11389
|
writable: !1,
|
|
11347
11390
|
configurable: !1,
|
|
11348
11391
|
enumerable: !1,
|
|
@@ -11904,13 +11947,10 @@ Help:
|
|
|
11904
11947
|
let value = Reflect.get(target, prop);
|
|
11905
11948
|
return 'function' == typeof value ? value.bind(target) : value;
|
|
11906
11949
|
},
|
|
11907
|
-
set: (_target, prop, value)=>'id' === prop &&
|
|
11950
|
+
set: (_target, prop, value)=>'id' === prop && ('string' == typeof value || 'number' == typeof value) && (assignments.set(m.identifier, value), !0)
|
|
11908
11951
|
}));
|
|
11909
11952
|
return queried.call(proxiedModules), {
|
|
11910
|
-
assignments: Object.fromEntries(
|
|
11911
|
-
k,
|
|
11912
|
-
String(v)
|
|
11913
|
-
]))
|
|
11953
|
+
assignments: Object.fromEntries(assignments.entries())
|
|
11914
11954
|
};
|
|
11915
11955
|
};
|
|
11916
11956
|
}),
|
|
@@ -12336,6 +12376,17 @@ Object.defineProperty(binding_default().ConcatenatedModule.prototype, 'identifie
|
|
|
12336
12376
|
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
12337
12377
|
}
|
|
12338
12378
|
});
|
|
12379
|
+
let ModuleGraphConnection = binding_namespaceObject.ModuleGraphConnection;
|
|
12380
|
+
Object.defineProperties(ModuleGraphConnection, {
|
|
12381
|
+
TRANSITIVE_ONLY: {
|
|
12382
|
+
value: binding_default().TRANSITIVE_ONLY_SYMBOL,
|
|
12383
|
+
enumerable: !0
|
|
12384
|
+
},
|
|
12385
|
+
CIRCULAR_CONNECTION: {
|
|
12386
|
+
value: binding_default().CIRCULAR_CONNECTION_SYMBOL,
|
|
12387
|
+
enumerable: !0
|
|
12388
|
+
}
|
|
12389
|
+
});
|
|
12339
12390
|
let asRegExp = (test)=>'string' == typeof test ? RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}`) : test, matchPart = (str, test)=>!test || (Array.isArray(test) ? test.map(asRegExp).some((regExp)=>regExp.test(str)) : asRegExp(test).test(str)), matchObject = (obj, str)=>!(obj.test && !matchPart(str, obj.test) || obj.include && !matchPart(str, obj.include) || obj.exclude && matchPart(str, obj.exclude)), FlagAllModulesAsUsedPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FlagAllModulesAsUsedPlugin, (explanation)=>({
|
|
12340
12391
|
explanation
|
|
12341
12392
|
}));
|
|
@@ -13300,7 +13351,7 @@ async function transform(source, options) {
|
|
|
13300
13351
|
let _options = JSON.stringify(options || {});
|
|
13301
13352
|
return binding_default().transform(source, _options);
|
|
13302
13353
|
}
|
|
13303
|
-
let exports_rspackVersion = "2.0.0-rc.
|
|
13354
|
+
let exports_rspackVersion = "2.0.0-rc.3", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13304
13355
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13305
13356
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13306
13357
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -13309,7 +13360,12 @@ let exports_rspackVersion = "2.0.0-rc.0", exports_version = "5.75.0", exports_We
|
|
|
13309
13360
|
createHash: createHash_createHash,
|
|
13310
13361
|
cleverMerge: cachedCleverMerge
|
|
13311
13362
|
}, web = {
|
|
13312
|
-
FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin
|
|
13363
|
+
FetchCompileAsyncWasmPlugin: FetchCompileAsyncWasmPlugin,
|
|
13364
|
+
JsonpTemplatePlugin: class {
|
|
13365
|
+
apply(compiler) {
|
|
13366
|
+
compiler.options.output.chunkLoading = 'jsonp', new ArrayPushCallbackChunkFormatPlugin().apply(compiler), new EnableChunkLoadingPlugin('jsonp').apply(compiler);
|
|
13367
|
+
}
|
|
13368
|
+
}
|
|
13313
13369
|
}, exports_node = {
|
|
13314
13370
|
NodeTargetPlugin: NodeTargetPlugin,
|
|
13315
13371
|
NodeTemplatePlugin: class {
|
|
@@ -13325,6 +13381,8 @@ let exports_rspackVersion = "2.0.0-rc.0", exports_version = "5.75.0", exports_We
|
|
|
13325
13381
|
NodeEnvironmentPlugin: NodeEnvironmentPlugin
|
|
13326
13382
|
}, electron = {
|
|
13327
13383
|
ElectronTargetPlugin: ElectronTargetPlugin
|
|
13384
|
+
}, exports_ids = {
|
|
13385
|
+
HashedModuleIdsPlugin: HashedModuleIdsPlugin
|
|
13328
13386
|
}, exports_library = {
|
|
13329
13387
|
EnableLibraryPlugin: EnableLibraryPlugin
|
|
13330
13388
|
}, exports_wasm = {
|
|
@@ -13333,7 +13391,11 @@ let exports_rspackVersion = "2.0.0-rc.0", exports_version = "5.75.0", exports_We
|
|
|
13333
13391
|
EnableChunkLoadingPlugin: EnableChunkLoadingPlugin,
|
|
13334
13392
|
JavascriptModulesPlugin: JavascriptModulesPlugin
|
|
13335
13393
|
}, webworker = {
|
|
13336
|
-
WebWorkerTemplatePlugin:
|
|
13394
|
+
WebWorkerTemplatePlugin: class {
|
|
13395
|
+
apply(compiler) {
|
|
13396
|
+
compiler.options.output.chunkLoading = "import-scripts", new ArrayPushCallbackChunkFormatPlugin().apply(compiler), new EnableChunkLoadingPlugin("import-scripts").apply(compiler);
|
|
13397
|
+
}
|
|
13398
|
+
}
|
|
13337
13399
|
}, optimize = {
|
|
13338
13400
|
LimitChunkCountPlugin: LimitChunkCountPlugin,
|
|
13339
13401
|
RuntimeChunkPlugin: RuntimeChunkPlugin,
|
|
@@ -13349,7 +13411,7 @@ let exports_rspackVersion = "2.0.0-rc.0", exports_version = "5.75.0", exports_We
|
|
|
13349
13411
|
}
|
|
13350
13412
|
apply(compiler) {
|
|
13351
13413
|
var options;
|
|
13352
|
-
let {
|
|
13414
|
+
let { rspack } = compiler, paths = function(options, compiler) {
|
|
13353
13415
|
let runtimeToolsPath;
|
|
13354
13416
|
if (options.implementation) runtimeToolsPath = options.implementation;
|
|
13355
13417
|
else try {
|
|
@@ -13425,7 +13487,7 @@ let exports_rspackVersion = "2.0.0-rc.0", exports_version = "5.75.0", exports_We
|
|
|
13425
13487
|
shared: this._options.shared,
|
|
13426
13488
|
enhanced: !0
|
|
13427
13489
|
};
|
|
13428
|
-
new
|
|
13490
|
+
new rspack.container.ModuleFederationPluginV1(v1Options).apply(compiler), this._options.manifest && new ModuleFederationManifestPlugin(this._options).apply(compiler);
|
|
13429
13491
|
}
|
|
13430
13492
|
},
|
|
13431
13493
|
ModuleFederationPluginV1: class {
|
|
@@ -13533,4 +13595,4 @@ src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
|
13533
13595
|
let src_rspack_0 = src_fn;
|
|
13534
13596
|
var AsyncDependenciesBlock = binding_namespaceObject.AsyncDependenciesBlock, ConcatenatedModule = binding_namespaceObject.ConcatenatedModule, ContextModule = binding_namespaceObject.ContextModule, Dependency = binding_namespaceObject.Dependency, EntryDependency = binding_namespaceObject.EntryDependency, ExternalModule = binding_namespaceObject.ExternalModule, Module = binding_namespaceObject.Module, NormalModule = binding_namespaceObject.NormalModule;
|
|
13535
13597
|
export default src_rspack_0;
|
|
13536
|
-
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, index_js_namespaceObject as sources, javascript, lazyCompilationMiddleware, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as "module.exports", src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
|
|
13598
|
+
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, ModuleGraphConnection, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_ids as ids, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, index_js_namespaceObject as sources, javascript, lazyCompilationMiddleware, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as "module.exports", src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/web/JsonpTemplatePlugin.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
|
+
*/
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
|
+
export default class JsonpTemplatePlugin {
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/webworker/WebWorkerTemplatePlugin.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
|
+
*/
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
|
+
export default class WebWorkerTemplatePlugin {
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
package/dist/worker.js
CHANGED
|
@@ -114,7 +114,7 @@ let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(
|
|
|
114
114
|
}, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf('...') ? 2 : 1 : 'object' != typeof value || null === value || value.constructor && value.constructor !== Object ? 1 : 3, cleverMerge = (first, second)=>void 0 === second ? first : void 0 === first || 'object' != typeof second || null === second ? second : 'object' != typeof first || null === first ? first : _cleverMerge(first, second, !1), _cleverMerge = (first, second, internalCaching = !1)=>{
|
|
115
115
|
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
116
116
|
if (void 0 !== firstDynamicInfo) {
|
|
117
|
-
let {
|
|
117
|
+
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
118
118
|
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
119
119
|
let newFn = (...args)=>{
|
|
120
120
|
let fnResult = fn(...args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-debug/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Fast Rust-based bundler for the web with a modernized webpack API",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"directory": "packages/rspack"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ast-grep/napi": "^0.42.
|
|
41
|
-
"@napi-rs/wasm-runtime": "1.1.
|
|
40
|
+
"@ast-grep/napi": "^0.42.1",
|
|
41
|
+
"@napi-rs/wasm-runtime": "1.1.3",
|
|
42
42
|
"@rsbuild/plugin-node-polyfill": "^1.4.4",
|
|
43
|
-
"@rslib/core": "0.
|
|
43
|
+
"@rslib/core": "0.21.0",
|
|
44
44
|
"@rspack/lite-tapable": "1.1.0",
|
|
45
45
|
"@swc/types": "0.1.26",
|
|
46
|
-
"@types/node": "^20.19.
|
|
46
|
+
"@types/node": "^20.19.39",
|
|
47
47
|
"@types/watchpack": "^2.4.5",
|
|
48
48
|
"browserslist-load-config": "^1.0.1",
|
|
49
49
|
"browserslist-to-es-version": "^1.4.1",
|
|
50
|
-
"connect-next": "^4.0.
|
|
50
|
+
"connect-next": "^4.0.1",
|
|
51
51
|
"enhanced-resolve": "5.20.1",
|
|
52
52
|
"http-proxy-middleware": "^3.0.5",
|
|
53
53
|
"memfs": "4.53.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"webpack-sources": "3.3.4"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@rspack/binding": "npm:@rspack-debug/binding@2.0.0-rc.
|
|
62
|
+
"@rspack/binding": "npm:@rspack-debug/binding@2.0.0-rc.3"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
-
import type { Compiler } from '../Compiler.js';
|
|
3
|
-
import { RspackBuiltinPlugin } from './base.js';
|
|
4
|
-
export declare class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
5
|
-
name: BuiltinPluginName;
|
|
6
|
-
raw(compiler: Compiler): BuiltinPlugin | undefined;
|
|
7
|
-
}
|