@rspack/core 2.0.0-rc.1 → 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/dist/ModuleGraphConnection.d.ts +3 -3
- package/dist/builtin-plugin/index.d.ts +0 -1
- package/dist/config/devServer.d.ts +2 -2
- package/dist/config/types.d.ts +42 -17
- package/dist/exports.d.ts +3 -1
- package/dist/index.js +79 -50
- 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 +5 -5
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import binding, { ModuleGraphConnection as BindingModuleGraphConnection } from '@rspack/binding';
|
|
2
2
|
type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
|
|
3
|
-
readonly TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY_SYMBOL;
|
|
4
|
-
readonly CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION_SYMBOL;
|
|
3
|
+
readonly TRANSITIVE_ONLY: typeof binding.TRANSITIVE_ONLY_SYMBOL;
|
|
4
|
+
readonly CIRCULAR_CONNECTION: typeof binding.CIRCULAR_CONNECTION_SYMBOL;
|
|
5
5
|
};
|
|
6
6
|
export interface ModuleGraphConnection extends BindingModuleGraphConnection {
|
|
7
7
|
}
|
|
@@ -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;
|
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.
|
|
@@ -1358,6 +1374,8 @@ export type MemoryCacheOptions = {
|
|
|
1358
1374
|
*/
|
|
1359
1375
|
export type CacheOptions = boolean | MemoryCacheOptions | PersistentCacheOptions;
|
|
1360
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[];
|
|
1361
1379
|
type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
|
|
1362
1380
|
type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
|
|
1363
1381
|
export type StatsColorOptions = {
|
|
@@ -1642,7 +1660,7 @@ export type StatsOptions = {
|
|
|
1642
1660
|
* Exclude the matching assets information.
|
|
1643
1661
|
* @default false
|
|
1644
1662
|
*/
|
|
1645
|
-
excludeAssets?:
|
|
1663
|
+
excludeAssets?: AssetFilterTypes;
|
|
1646
1664
|
/**
|
|
1647
1665
|
* Specifies the sorting order for modules.
|
|
1648
1666
|
* @default 'id'
|
|
@@ -1822,6 +1840,13 @@ type SharedOptimizationSplitChunksCacheGroup = {
|
|
|
1822
1840
|
*/
|
|
1823
1841
|
minSize?: OptimizationSplitChunksSizes;
|
|
1824
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;
|
|
1825
1850
|
/** Maximum size, in bytes, for a chunk to be generated. */
|
|
1826
1851
|
maxSize?: OptimizationSplitChunksSizes;
|
|
1827
1852
|
/** Maximum size, in bytes, for a async chunk to be generated. */
|
|
@@ -2216,13 +2241,13 @@ export type Watch = boolean;
|
|
|
2216
2241
|
export type WatchOptions = {
|
|
2217
2242
|
/**
|
|
2218
2243
|
* Add a delay before rebuilding once the first file changed.
|
|
2219
|
-
* This allows
|
|
2244
|
+
* This allows Rspack to aggregate any other changes made during this time period into one rebuild.
|
|
2220
2245
|
* @default 5
|
|
2221
2246
|
*/
|
|
2222
2247
|
aggregateTimeout?: number;
|
|
2223
2248
|
/**
|
|
2224
2249
|
* Follow symlinks while looking for files.
|
|
2225
|
-
* This is usually not needed as
|
|
2250
|
+
* This is usually not needed as Rspack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
|
|
2226
2251
|
*/
|
|
2227
2252
|
followSymlinks?: boolean;
|
|
2228
2253
|
/**
|
|
@@ -2281,13 +2306,13 @@ export type Performance = false | {
|
|
|
2281
2306
|
*/
|
|
2282
2307
|
hints?: false | 'warning' | 'error';
|
|
2283
2308
|
/**
|
|
2284
|
-
* File size limit (in bytes) when exceeded,
|
|
2285
|
-
* @default
|
|
2309
|
+
* File size limit (in bytes) when exceeded, Rspack will provide performance hints.
|
|
2310
|
+
* @default 307200 (300 KiB)
|
|
2286
2311
|
*/
|
|
2287
2312
|
maxAssetSize?: number;
|
|
2288
2313
|
/**
|
|
2289
2314
|
* Total size of an entry point (in bytes).
|
|
2290
|
-
* @default
|
|
2315
|
+
* @default 512000 (500 KiB)
|
|
2291
2316
|
*/
|
|
2292
2317
|
maxEntrypointSize?: number;
|
|
2293
2318
|
};
|
package/dist/exports.d.ts
CHANGED
|
@@ -57,9 +57,11 @@ export { LoaderOptionsPlugin } from './lib/LoaderOptionsPlugin.js';
|
|
|
57
57
|
export { LoaderTargetPlugin } from './lib/LoaderTargetPlugin.js';
|
|
58
58
|
export type { OutputFileSystem, WatchFileSystem } from './util/fs.js';
|
|
59
59
|
import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, rsc, SubresourceIntegrityPlugin } from './builtin-plugin/index.js';
|
|
60
|
+
import JsonpTemplatePlugin from './web/JsonpTemplatePlugin.js';
|
|
60
61
|
export { SubresourceIntegrityPlugin };
|
|
61
62
|
interface Web {
|
|
62
63
|
FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
|
|
64
|
+
JsonpTemplatePlugin: typeof JsonpTemplatePlugin;
|
|
63
65
|
}
|
|
64
66
|
export declare const web: Web;
|
|
65
67
|
import { NodeTargetPlugin } from './builtin-plugin/index.js';
|
|
@@ -98,7 +100,7 @@ interface JavaScript {
|
|
|
98
100
|
JavascriptModulesPlugin: typeof JavascriptModulesPlugin;
|
|
99
101
|
}
|
|
100
102
|
export declare const javascript: JavaScript;
|
|
101
|
-
import
|
|
103
|
+
import WebWorkerTemplatePlugin from './webworker/WebWorkerTemplatePlugin.js';
|
|
102
104
|
interface Webworker {
|
|
103
105
|
WebWorkerTemplatePlugin: typeof WebWorkerTemplatePlugin;
|
|
104
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;
|
|
@@ -1832,10 +1832,26 @@ function createDiagnosticArray(adm) {
|
|
|
1832
1832
|
});
|
|
1833
1833
|
return adm[$proxy] = proxy, proxy;
|
|
1834
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
|
+
}
|
|
1835
1851
|
let checkCompilation = (compilation)=>{
|
|
1836
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.');
|
|
1837
1853
|
};
|
|
1838
|
-
_computedKey = binding_default().COMPILATION_HOOKS_MAP_SYMBOL;
|
|
1854
|
+
_computedKey = _to_property_key(binding_default().COMPILATION_HOOKS_MAP_SYMBOL);
|
|
1839
1855
|
class Compilation {
|
|
1840
1856
|
#inner;
|
|
1841
1857
|
#shutdown;
|
|
@@ -2351,7 +2367,7 @@ class EntryData {
|
|
|
2351
2367
|
this.dependencies = binding.dependencies, this.includeDependencies = binding.includeDependencies, this.options = binding.options;
|
|
2352
2368
|
}
|
|
2353
2369
|
}
|
|
2354
|
-
_computedKey1 = Symbol.iterator, _computedKey2 = Symbol.toStringTag;
|
|
2370
|
+
_computedKey1 = _to_property_key(Symbol.iterator), _computedKey2 = _to_property_key(Symbol.toStringTag);
|
|
2355
2371
|
class Entries {
|
|
2356
2372
|
#data;
|
|
2357
2373
|
constructor(data){
|
|
@@ -2718,7 +2734,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2718
2734
|
function getChunks(chunks) {
|
|
2719
2735
|
return 'function' == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
|
2720
2736
|
}
|
|
2721
|
-
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;
|
|
2722
2738
|
return {
|
|
2723
2739
|
name: getName(name),
|
|
2724
2740
|
chunks: getChunks(chunks),
|
|
@@ -2727,7 +2743,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2727
2743
|
'unknown'
|
|
2728
2744
|
],
|
|
2729
2745
|
cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>!1 !== group).map(([key, group])=>{
|
|
2730
|
-
let { test, name, chunks, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
2746
|
+
let { test, name, chunks, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
2731
2747
|
return {
|
|
2732
2748
|
key,
|
|
2733
2749
|
test: 'function' == typeof test ? (ctx)=>{
|
|
@@ -2741,6 +2757,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2741
2757
|
chunks: getChunks(chunks),
|
|
2742
2758
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2743
2759
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2760
|
+
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
2744
2761
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2745
2762
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2746
2763
|
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
@@ -2753,6 +2770,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
|
|
|
2753
2770
|
},
|
|
2754
2771
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2755
2772
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2773
|
+
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
2756
2774
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2757
2775
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2758
2776
|
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
@@ -4301,19 +4319,16 @@ function tryMatch(payload, condition) {
|
|
|
4301
4319
|
return !1;
|
|
4302
4320
|
}
|
|
4303
4321
|
let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
4304
|
-
let funcUse
|
|
4305
|
-
if (rule.loader && (rule.use = [
|
|
4322
|
+
let funcUse, normalizedUse = rule.loader ? [
|
|
4306
4323
|
{
|
|
4307
4324
|
loader: rule.loader,
|
|
4308
4325
|
options: rule.options
|
|
4309
4326
|
}
|
|
4310
|
-
]
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
}) ?? [], `${path}.use`, options);
|
|
4316
|
-
}
|
|
4327
|
+
] : rule.use;
|
|
4328
|
+
'function' == typeof normalizedUse && (funcUse = (rawContext)=>createRawModuleRuleUses(normalizedUse({
|
|
4329
|
+
...rawContext,
|
|
4330
|
+
compiler: options.compiler
|
|
4331
|
+
}) ?? [], `${path}.use`, options));
|
|
4317
4332
|
let rawModuleRule = {
|
|
4318
4333
|
test: rule.test ? getRawRuleSetCondition(rule.test) : void 0,
|
|
4319
4334
|
include: rule.include ? getRawRuleSetCondition(rule.include) : void 0,
|
|
@@ -4335,7 +4350,7 @@ let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
|
4335
4350
|
scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
|
|
4336
4351
|
mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
|
|
4337
4352
|
sideEffects: rule.sideEffects,
|
|
4338
|
-
use: 'function' == typeof
|
|
4353
|
+
use: 'function' == typeof normalizedUse ? funcUse : createRawModuleRuleUses(normalizedUse ?? [], `${path}.use`, options),
|
|
4339
4354
|
type: rule.type,
|
|
4340
4355
|
layer: rule.layer,
|
|
4341
4356
|
parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
|
|
@@ -5382,12 +5397,6 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
|
|
|
5382
5397
|
}
|
|
5383
5398
|
};
|
|
5384
5399
|
}, 'compilation'), URLPlugin = base_create(binding_namespaceObject.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
5385
|
-
class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
5386
|
-
name = binding_namespaceObject.BuiltinPluginName.WebWorkerTemplatePlugin;
|
|
5387
|
-
raw(compiler) {
|
|
5388
|
-
return compiler.options.output.chunkLoading = "import-scripts", createBuiltinPlugin(this.name, void 0);
|
|
5389
|
-
}
|
|
5390
|
-
}
|
|
5391
5400
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
5392
5401
|
chunkLoading;
|
|
5393
5402
|
wasmLoading;
|
|
@@ -5536,7 +5545,7 @@ let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(
|
|
|
5536
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)=>{
|
|
5537
5546
|
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
5538
5547
|
if (void 0 !== firstDynamicInfo) {
|
|
5539
|
-
let {
|
|
5548
|
+
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
5540
5549
|
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
5541
5550
|
let newFn = (...args)=>{
|
|
5542
5551
|
let fnResult = fn(...args);
|
|
@@ -6780,7 +6789,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6780
6789
|
return 'function' != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, '.css$1') : '[id].css';
|
|
6781
6790
|
}), D(output, 'hotUpdateChunkFilename', `[id].[fullhash].hot-update.${output.module ? 'mjs' : 'js'}`), F(output, 'hotUpdateMainFilename', ()=>`[runtime].[fullhash].hot-update.${output.module ? 'json.mjs' : 'json'}`);
|
|
6782
6791
|
let uniqueNameId = Template.toIdentifier(output.uniqueName);
|
|
6783
|
-
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', ()=>{
|
|
6784
6797
|
if (tp) {
|
|
6785
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.";
|
|
6786
6799
|
if (output.module) {
|
|
@@ -6852,7 +6865,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6852
6865
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6853
6866
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6854
6867
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6855
|
-
}), 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));
|
|
6856
6869
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6857
6870
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6858
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')));
|
|
@@ -6868,7 +6881,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6868
6881
|
}, applyNodeDefaults = (node, { outputModule, targetProperties })=>{
|
|
6869
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'));
|
|
6870
6883
|
}, applyPerformanceDefaults = (performance, { production })=>{
|
|
6871
|
-
!1 !== performance && (D(performance, 'maxAssetSize',
|
|
6884
|
+
!1 !== performance && (D(performance, 'maxAssetSize', 307200), D(performance, 'maxEntrypointSize', 512000), F(performance, 'hints', ()=>!!production && 'warning'));
|
|
6872
6885
|
}, applyOptimizationDefaults = (optimization, { production, development })=>{
|
|
6873
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', ()=>[
|
|
6874
6887
|
new SwcJsMinimizerRspackPlugin(),
|
|
@@ -6880,7 +6893,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6880
6893
|
"javascript",
|
|
6881
6894
|
'css',
|
|
6882
6895
|
'unknown'
|
|
6883
|
-
]), 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', '-');
|
|
6884
6897
|
let { cacheGroups } = splitChunks;
|
|
6885
6898
|
cacheGroups && (F(cacheGroups, 'default', ()=>({
|
|
6886
6899
|
idHint: '',
|
|
@@ -8106,7 +8119,7 @@ class MultiStats {
|
|
|
8106
8119
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8107
8120
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8108
8121
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8109
|
-
}), 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(''));
|
|
8110
8123
|
let mapError = (j, obj)=>({
|
|
8111
8124
|
...obj,
|
|
8112
8125
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8181,7 +8194,19 @@ let asyncLib_each = function(collection, iterator, originalCallback) {
|
|
|
8181
8194
|
for (let watching of this.watchings)watching.resume();
|
|
8182
8195
|
}
|
|
8183
8196
|
};
|
|
8184
|
-
|
|
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);
|
|
8185
8210
|
let util_ArrayQueue = class {
|
|
8186
8211
|
_list;
|
|
8187
8212
|
_listReversed;
|
|
@@ -9365,7 +9390,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9365
9390
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9366
9391
|
},
|
|
9367
9392
|
version: (object)=>{
|
|
9368
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.0-rc.
|
|
9393
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.0-rc.3";
|
|
9369
9394
|
},
|
|
9370
9395
|
env: (object, _compilation, _context, { _env })=>{
|
|
9371
9396
|
object.env = _env;
|
|
@@ -10684,16 +10709,14 @@ class RspackOptionsApply {
|
|
|
10684
10709
|
compiler.hooks.afterResolvers.call(compiler);
|
|
10685
10710
|
}
|
|
10686
10711
|
}
|
|
10687
|
-
let
|
|
10712
|
+
let validateConfig_ERROR_PREFIX = 'Invalid Rspack configuration:';
|
|
10688
10713
|
function validateRspackConfig(config) {
|
|
10689
10714
|
(({ context })=>{
|
|
10690
|
-
if (context && !isAbsolute(context)) throw Error(`${
|
|
10691
|
-
})(config), (({ output })=>{
|
|
10692
|
-
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}".`);
|
|
10693
10716
|
})(config), (({ optimization })=>{
|
|
10694
10717
|
if (optimization?.splitChunks) {
|
|
10695
10718
|
let { minChunks } = optimization.splitChunks;
|
|
10696
|
-
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}\`.`);
|
|
10697
10720
|
}
|
|
10698
10721
|
})(config), (({ output, externals, externalsType })=>{
|
|
10699
10722
|
let library = output?.library;
|
|
@@ -10706,7 +10729,7 @@ function validateRspackConfig(config) {
|
|
|
10706
10729
|
'commonjs',
|
|
10707
10730
|
'commonjs2',
|
|
10708
10731
|
'amd'
|
|
10709
|
-
].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)}.`);
|
|
10710
10733
|
};
|
|
10711
10734
|
Array.isArray(externals) ? externals.forEach((external)=>checkExternalItem(external)) : checkExternalItem(externals);
|
|
10712
10735
|
})(config);
|
|
@@ -11025,7 +11048,7 @@ class TraceHookPlugin {
|
|
|
11025
11048
|
});
|
|
11026
11049
|
}
|
|
11027
11050
|
}
|
|
11028
|
-
let CORE_VERSION = "2.0.0-rc.
|
|
11051
|
+
let CORE_VERSION = "2.0.0-rc.3", VFILES_BY_COMPILER = new WeakMap();
|
|
11029
11052
|
class VirtualModulesPlugin {
|
|
11030
11053
|
#staticModules;
|
|
11031
11054
|
#compiler;
|
|
@@ -11362,7 +11385,7 @@ class Compiler {
|
|
|
11362
11385
|
electron: null
|
|
11363
11386
|
}, this.#target = {}, this.__internal_browser_require = ()=>{
|
|
11364
11387
|
throw Error('Cannot execute user defined code in browser without `BrowserRequirePlugin`');
|
|
11365
|
-
}, 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, {
|
|
11366
11389
|
writable: !1,
|
|
11367
11390
|
configurable: !1,
|
|
11368
11391
|
enumerable: !1,
|
|
@@ -11924,13 +11947,10 @@ Help:
|
|
|
11924
11947
|
let value = Reflect.get(target, prop);
|
|
11925
11948
|
return 'function' == typeof value ? value.bind(target) : value;
|
|
11926
11949
|
},
|
|
11927
|
-
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)
|
|
11928
11951
|
}));
|
|
11929
11952
|
return queried.call(proxiedModules), {
|
|
11930
|
-
assignments: Object.fromEntries(
|
|
11931
|
-
k,
|
|
11932
|
-
String(v)
|
|
11933
|
-
]))
|
|
11953
|
+
assignments: Object.fromEntries(assignments.entries())
|
|
11934
11954
|
};
|
|
11935
11955
|
};
|
|
11936
11956
|
}),
|
|
@@ -12359,11 +12379,11 @@ Object.defineProperty(binding_default().ConcatenatedModule.prototype, 'identifie
|
|
|
12359
12379
|
let ModuleGraphConnection = binding_namespaceObject.ModuleGraphConnection;
|
|
12360
12380
|
Object.defineProperties(ModuleGraphConnection, {
|
|
12361
12381
|
TRANSITIVE_ONLY: {
|
|
12362
|
-
value:
|
|
12382
|
+
value: binding_default().TRANSITIVE_ONLY_SYMBOL,
|
|
12363
12383
|
enumerable: !0
|
|
12364
12384
|
},
|
|
12365
12385
|
CIRCULAR_CONNECTION: {
|
|
12366
|
-
value:
|
|
12386
|
+
value: binding_default().CIRCULAR_CONNECTION_SYMBOL,
|
|
12367
12387
|
enumerable: !0
|
|
12368
12388
|
}
|
|
12369
12389
|
});
|
|
@@ -13331,7 +13351,7 @@ async function transform(source, options) {
|
|
|
13331
13351
|
let _options = JSON.stringify(options || {});
|
|
13332
13352
|
return binding_default().transform(source, _options);
|
|
13333
13353
|
}
|
|
13334
|
-
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 = {
|
|
13335
13355
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13336
13356
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13337
13357
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -13340,7 +13360,12 @@ let exports_rspackVersion = "2.0.0-rc.1", exports_version = "5.75.0", exports_We
|
|
|
13340
13360
|
createHash: createHash_createHash,
|
|
13341
13361
|
cleverMerge: cachedCleverMerge
|
|
13342
13362
|
}, web = {
|
|
13343
|
-
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
|
+
}
|
|
13344
13369
|
}, exports_node = {
|
|
13345
13370
|
NodeTargetPlugin: NodeTargetPlugin,
|
|
13346
13371
|
NodeTemplatePlugin: class {
|
|
@@ -13366,7 +13391,11 @@ let exports_rspackVersion = "2.0.0-rc.1", exports_version = "5.75.0", exports_We
|
|
|
13366
13391
|
EnableChunkLoadingPlugin: EnableChunkLoadingPlugin,
|
|
13367
13392
|
JavascriptModulesPlugin: JavascriptModulesPlugin
|
|
13368
13393
|
}, webworker = {
|
|
13369
|
-
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
|
+
}
|
|
13370
13399
|
}, optimize = {
|
|
13371
13400
|
LimitChunkCountPlugin: LimitChunkCountPlugin,
|
|
13372
13401
|
RuntimeChunkPlugin: RuntimeChunkPlugin,
|
|
@@ -13382,7 +13411,7 @@ let exports_rspackVersion = "2.0.0-rc.1", exports_version = "5.75.0", exports_We
|
|
|
13382
13411
|
}
|
|
13383
13412
|
apply(compiler) {
|
|
13384
13413
|
var options;
|
|
13385
|
-
let {
|
|
13414
|
+
let { rspack } = compiler, paths = function(options, compiler) {
|
|
13386
13415
|
let runtimeToolsPath;
|
|
13387
13416
|
if (options.implementation) runtimeToolsPath = options.implementation;
|
|
13388
13417
|
else try {
|
|
@@ -13458,7 +13487,7 @@ let exports_rspackVersion = "2.0.0-rc.1", exports_version = "5.75.0", exports_We
|
|
|
13458
13487
|
shared: this._options.shared,
|
|
13459
13488
|
enhanced: !0
|
|
13460
13489
|
};
|
|
13461
|
-
new
|
|
13490
|
+
new rspack.container.ModuleFederationPluginV1(v1Options).apply(compiler), this._options.manifest && new ModuleFederationManifestPlugin(this._options).apply(compiler);
|
|
13462
13491
|
}
|
|
13463
13492
|
},
|
|
13464
13493
|
ModuleFederationPluginV1: class {
|
|
@@ -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/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,10 +37,10 @@
|
|
|
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
46
|
"@types/node": "^20.19.39",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"webpack-sources": "3.3.4"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@rspack/binding": "2.0.0-rc.
|
|
62
|
+
"@rspack/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
|
-
}
|