@rspack/core 2.0.0-beta.2 → 2.0.0-beta.4
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/webpack-sources/index.js +188 -131
- package/compiled/webpack-sources/package.json +1 -1
- package/compiled/webpack-sources/types.d.ts +6 -3
- package/dist/Compilation.d.ts +1 -1
- package/dist/Compiler.d.ts +1 -1
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/MultiWatching.d.ts +1 -1
- package/dist/NormalModule.d.ts +1 -1
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Watching.d.ts +1 -1
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +4 -2
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/config/types.d.ts +6 -0
- package/dist/exports.d.ts +1 -1
- package/dist/index.js +98 -93
- package/dist/lib/Cache.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +1 -1
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/module.d.ts +4 -2
- package/package.json +6 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"webpack-sources","author":"Tobias Koppers @sokra","version":"3.3.
|
|
1
|
+
{"name":"webpack-sources","author":"Tobias Koppers @sokra","version":"3.3.4","license":"MIT","types":"types.d.ts","type":"commonjs"}
|
|
@@ -371,7 +371,7 @@ declare class SourceMapSource extends Source {
|
|
|
371
371
|
name: string,
|
|
372
372
|
sourceMap?: string | RawSourceMap | Buffer,
|
|
373
373
|
originalSource?: string | Buffer,
|
|
374
|
-
innerSourceMap?: string | RawSourceMap | Buffer,
|
|
374
|
+
innerSourceMap?: null | string | RawSourceMap | Buffer,
|
|
375
375
|
removeOriginalSource?: boolean,
|
|
376
376
|
);
|
|
377
377
|
getArgsAsBuffers(): [
|
|
@@ -407,14 +407,15 @@ declare interface StreamChunksOptions {
|
|
|
407
407
|
finalSource?: boolean;
|
|
408
408
|
columns?: boolean;
|
|
409
409
|
}
|
|
410
|
+
|
|
410
411
|
export namespace util {
|
|
411
412
|
export namespace stringBufferUtils {
|
|
412
413
|
export let disableDualStringBufferCaching: () => void;
|
|
413
414
|
export let enableDualStringBufferCaching: () => void;
|
|
414
|
-
export let internString: (str: string) => string;
|
|
415
|
-
export let isDualStringBufferCachingEnabled: () => boolean;
|
|
416
415
|
export let enterStringInterningRange: () => void;
|
|
417
416
|
export let exitStringInterningRange: () => void;
|
|
417
|
+
export let internString: (str: string) => string;
|
|
418
|
+
export let isDualStringBufferCachingEnabled: () => boolean;
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
export type OnChunk = (
|
|
@@ -456,3 +457,5 @@ declare interface StreamChunksOptions {
|
|
|
456
457
|
StreamChunksOptions,
|
|
457
458
|
};
|
|
458
459
|
|
|
460
|
+
|
|
461
|
+
|
package/dist/Compilation.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
|
|
11
11
|
import binding from '@rspack/binding';
|
|
12
12
|
export type { AssetInfo } from '@rspack/binding';
|
|
13
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
13
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
14
14
|
import type { Source } from '../compiled/webpack-sources';
|
|
15
15
|
import type { EntryOptions, EntryPlugin } from './builtin-plugin/index.js';
|
|
16
16
|
import type { Chunk } from './Chunk.js';
|
package/dist/Compiler.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type binding from '@rspack/binding';
|
|
11
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
11
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
12
12
|
import type Watchpack from '../compiled/watchpack';
|
|
13
13
|
import type { Source } from '../compiled/webpack-sources';
|
|
14
14
|
import type { Chunk } from './Chunk.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
1
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
2
2
|
import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from './Module.js';
|
|
3
3
|
export declare class ContextModuleFactory {
|
|
4
4
|
hooks: {
|
package/dist/MultiCompiler.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import type { CompilationParams, Compiler, CompilerHooks, RspackOptions } from './index.js';
|
|
12
12
|
import type { WatchOptions } from './config/index.js';
|
|
13
13
|
import MultiStats from './MultiStats.js';
|
package/dist/MultiWatching.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import type { Callback } from '../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import type { MultiCompiler } from './MultiCompiler.js';
|
|
12
12
|
import type { Watching } from './Watching.js';
|
|
13
13
|
declare class MultiWatching {
|
package/dist/NormalModule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
1
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
2
2
|
import type { Compilation } from './Compilation.js';
|
|
3
3
|
import type { LoaderContext } from './config/index.js';
|
|
4
4
|
import type { Module } from './Module.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type binding from '@rspack/binding';
|
|
2
|
-
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist
|
|
2
|
+
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist';
|
|
3
3
|
import type { ResolveData, ResourceDataWithData } from './Module.js';
|
|
4
4
|
import type { ResolveOptionsWithDependencyType, ResolverFactory } from './ResolverFactory.js';
|
|
5
5
|
export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
|
package/dist/Watching.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import type { Callback } from '../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import type { Compiler } from './index.js';
|
|
12
12
|
import { Stats } from './index.js';
|
|
13
13
|
import type { WatchOptions } from './config/index.js';
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Compiler } from '../Compiler.js';
|
|
2
|
-
import type { RspackOptionsNormalized } from '../config/index.js';
|
|
2
|
+
import type { OptimizationSplitChunksOptions, RspackOptionsNormalized } from '../config/index.js';
|
|
3
3
|
export declare function applyLimits(options: RspackOptionsNormalized): void;
|
|
4
4
|
export declare class EsmLibraryPlugin {
|
|
5
5
|
static PLUGIN_NAME: string;
|
|
6
|
-
options
|
|
6
|
+
options: {
|
|
7
7
|
preserveModules?: string;
|
|
8
|
+
splitChunks?: OptimizationSplitChunksOptions | false;
|
|
8
9
|
};
|
|
9
10
|
constructor(options?: {
|
|
10
11
|
preserveModules?: string;
|
|
12
|
+
splitChunks?: OptimizationSplitChunksOptions | false;
|
|
11
13
|
});
|
|
12
14
|
apply(compiler: Compiler): void;
|
|
13
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
-
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist
|
|
2
|
+
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist';
|
|
3
3
|
import type { Chunk } from '../Chunk.js';
|
|
4
4
|
import { type Compilation } from '../Compilation.js';
|
|
5
5
|
import type Hash from '../util/hash/index.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type RawProgressPluginOptions } from '@rspack/binding';
|
|
2
|
-
export type
|
|
1
|
+
import { type RawProgressPluginHandlerInfo, type RawProgressPluginOptions } from '@rspack/binding';
|
|
2
|
+
export type ProgressPluginOptions = Partial<Omit<RawProgressPluginOptions, 'handler'>> | ((percentage: number, msg: string, info: RawProgressPluginHandlerInfo) => void) | undefined;
|
|
3
|
+
export type ProgressPluginHandlerInfo = RawProgressPluginHandlerInfo;
|
|
3
4
|
export declare const ProgressPlugin: {
|
|
4
|
-
new (progress?:
|
|
5
|
+
new (progress?: ProgressPluginOptions): {
|
|
5
6
|
name: string;
|
|
6
|
-
_args: [progress?:
|
|
7
|
+
_args: [progress?: ProgressPluginOptions];
|
|
7
8
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
8
9
|
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
9
10
|
apply(compiler: import("../index.js").Compiler): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '@rspack/binding';
|
|
2
|
-
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist
|
|
2
|
+
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist';
|
|
3
3
|
import { type Compilation } from '../Compilation.js';
|
|
4
4
|
import type { Compiler } from '../Compiler.js';
|
|
5
5
|
import type { CreatePartialRegisters } from '../taps/types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import binding from '@rspack/binding';
|
|
2
|
-
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist
|
|
2
|
+
import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist';
|
|
3
3
|
import type { Chunk } from '../Chunk.js';
|
|
4
4
|
import { type Compilation } from '../Compilation.js';
|
|
5
5
|
import type { CreatePartialRegisters } from '../taps/types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawSplitChunksOptions } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
3
|
import type { OptimizationSplitChunksOptions } from '../config/index.js';
|
|
4
4
|
import { RspackBuiltinPlugin } from './base.js';
|
|
@@ -9,3 +9,4 @@ export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
|
9
9
|
constructor(options: OptimizationSplitChunksOptions);
|
|
10
10
|
raw(compiler: Compiler): BuiltinPlugin;
|
|
11
11
|
}
|
|
12
|
+
export declare function toRawSplitChunksOptions(sc: false | OptimizationSplitChunksOptions, compiler: Compiler): RawSplitChunksOptions | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from '@rspack/binding';
|
|
2
|
-
import * as liteTapable from '../../../compiled/@rspack/lite-tapable/dist
|
|
2
|
+
import * as liteTapable from '../../../compiled/@rspack/lite-tapable/dist';
|
|
3
3
|
import { type Compilation } from '../../Compilation.js';
|
|
4
4
|
import type { HtmlRspackPluginOptions } from './options.js';
|
|
5
5
|
type ExtraPluginHookData = {
|
package/dist/config/types.d.ts
CHANGED
|
@@ -601,6 +601,8 @@ export type ResolveOptions = {
|
|
|
601
601
|
byDependency?: Record<string, ResolveOptions>;
|
|
602
602
|
/** enable Yarn PnP */
|
|
603
603
|
pnp?: boolean;
|
|
604
|
+
/** Path to PnP manifest file */
|
|
605
|
+
pnpManifest?: string | false;
|
|
604
606
|
};
|
|
605
607
|
/** Used to configure the Rspack module resolution */
|
|
606
608
|
export type Resolve = ResolveOptions;
|
|
@@ -2085,6 +2087,10 @@ export type Incremental = {
|
|
|
2085
2087
|
* Enable incremental build chunk graph.
|
|
2086
2088
|
*/
|
|
2087
2089
|
buildChunkGraph?: boolean;
|
|
2090
|
+
/**
|
|
2091
|
+
* Enable incremental optimize chunk modules.
|
|
2092
|
+
*/
|
|
2093
|
+
optimizeChunkModules?: boolean;
|
|
2088
2094
|
/**
|
|
2089
2095
|
* Enable incremental module ids.
|
|
2090
2096
|
*/
|
package/dist/exports.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare const util: {
|
|
|
46
46
|
createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
|
|
47
47
|
cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
48
48
|
};
|
|
49
|
-
export type { BannerPluginArgument, DefinePluginOptions, EntryOptions,
|
|
49
|
+
export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginHandlerInfo, ProgressPluginOptions, ProvidePluginOptions, } from './builtin-plugin/index.js';
|
|
50
50
|
export { BannerPlugin, CaseSensitivePlugin, DefinePlugin, DynamicEntryPlugin, EntryPlugin, ExternalsPlugin, HotModuleReplacementPlugin, IgnorePlugin, type IgnorePluginOptions, NoEmitOnErrorsPlugin, ProgressPlugin, ProvidePlugin, RuntimePlugin, } from './builtin-plugin/index.js';
|
|
51
51
|
export { DllPlugin, type DllPluginOptions } from './lib/DllPlugin.js';
|
|
52
52
|
export { DllReferencePlugin, type DllReferencePluginOptions, type DllReferencePluginOptionsContent, type DllReferencePluginOptionsManifest, type DllReferencePluginOptionsSourceType, } from './lib/DllReferencePlugin.js';
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import node_path, { isAbsolute, join, relative, resolve as external_node_path_re
|
|
|
8
8
|
import node_querystring from "node:querystring";
|
|
9
9
|
import node_fs, { readFileSync } from "node:fs";
|
|
10
10
|
__webpack_require__.add({
|
|
11
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
11
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12
12
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
13
13
|
let idx = path.length - 1;
|
|
14
14
|
for(; idx >= 0;){
|
|
@@ -812,7 +812,7 @@ let lib_WebpackError = WebpackError, LogType = Object.freeze({
|
|
|
812
812
|
cache: 'cache'
|
|
813
813
|
});
|
|
814
814
|
function getLogTypeBitFlag(type) {
|
|
815
|
-
return 1 << Object.values(LogType).
|
|
815
|
+
return 1 << Object.values(LogType).indexOf(type);
|
|
816
816
|
}
|
|
817
817
|
function getLogTypesBitFlag(types) {
|
|
818
818
|
return types.reduce((acc, cur)=>acc | getLogTypeBitFlag(cur), 0);
|
|
@@ -1789,10 +1789,10 @@ function createDiagnosticArray(adm) {
|
|
|
1789
1789
|
reduce: (callbackfn, initialValue)=>adm.values().reduce(callbackfn, initialValue),
|
|
1790
1790
|
reduceRight: (callbackfn, initialValue)=>adm.values().reduceRight(callbackfn, initialValue)
|
|
1791
1791
|
}, proxy = new Proxy(array, {
|
|
1792
|
-
get: (target, name)=>'length' === name ? adm.length : 'string' != typeof name || Number.isNaN(Number.parseInt(name)) ? Object.prototype.hasOwnProperty.call(arrayExtensions, name) ? arrayExtensions[name] : target[name] : adm.get(Number.parseInt(name)),
|
|
1792
|
+
get: (target, name)=>'length' === name ? adm.length : 'string' != typeof name || Number.isNaN(Number.parseInt(name, 10)) ? Object.prototype.hasOwnProperty.call(arrayExtensions, name) ? arrayExtensions[name] : target[name] : adm.get(Number.parseInt(name, 10)),
|
|
1793
1793
|
set (target, name, value) {
|
|
1794
1794
|
if ('length' === name) throw Error("The 'length' property is read-only and cannot be assigned a new value.");
|
|
1795
|
-
return 'symbol' == typeof name || Number.isNaN(Number.parseInt(name)) ? target[name] = value : adm.set(Number.parseInt(name), value), !0;
|
|
1795
|
+
return 'symbol' == typeof name || Number.isNaN(Number.parseInt(name, 10)) ? target[name] = value : adm.set(Number.parseInt(name, 10), value), !0;
|
|
1796
1796
|
}
|
|
1797
1797
|
});
|
|
1798
1798
|
return adm[$proxy] = proxy, proxy;
|
|
@@ -2671,8 +2671,77 @@ class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
}
|
|
2673
2673
|
let EnableWasmLoadingPlugin = base_create(binding_namespaceObject.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type), EnsureChunkConditionsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{}), RemoveDuplicateModulesPlugin = base_create(binding_namespaceObject.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({}));
|
|
2674
|
+
class JsSplitChunkSizes {
|
|
2675
|
+
static __to_binding(sizes) {
|
|
2676
|
+
return 'number' == typeof sizes ? sizes : sizes && 'object' == typeof sizes ? {
|
|
2677
|
+
sizes: sizes
|
|
2678
|
+
} : sizes;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
2682
|
+
options;
|
|
2683
|
+
name = binding_namespaceObject.BuiltinPluginName.SplitChunksPlugin;
|
|
2684
|
+
affectedHooks = 'thisCompilation';
|
|
2685
|
+
constructor(options){
|
|
2686
|
+
super(), this.options = options;
|
|
2687
|
+
}
|
|
2688
|
+
raw(compiler) {
|
|
2689
|
+
let rawOptions = toRawSplitChunksOptions(this.options, compiler);
|
|
2690
|
+
if (void 0 === rawOptions) throw Error('rawOptions should not be undefined');
|
|
2691
|
+
return createBuiltinPlugin(this.name, rawOptions);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
function toRawSplitChunksOptions(sc, compiler) {
|
|
2695
|
+
if (!sc) return;
|
|
2696
|
+
function getName(name) {
|
|
2697
|
+
return 'function' == typeof name ? (ctx)=>void 0 === ctx.module ? name(void 0) : name(ctx.module, getChunks(ctx.chunks), ctx.cacheGroupKey) : name;
|
|
2698
|
+
}
|
|
2699
|
+
function getChunks(chunks) {
|
|
2700
|
+
return 'function' == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
|
2701
|
+
}
|
|
2702
|
+
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
2703
|
+
return {
|
|
2704
|
+
name: getName(name),
|
|
2705
|
+
chunks: getChunks(chunks),
|
|
2706
|
+
defaultSizeTypes: defaultSizeTypes || [
|
|
2707
|
+
"javascript",
|
|
2708
|
+
'unknown'
|
|
2709
|
+
],
|
|
2710
|
+
cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>!1 !== group).map(([key, group])=>{
|
|
2711
|
+
let { test, name, chunks, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
2712
|
+
return {
|
|
2713
|
+
key,
|
|
2714
|
+
test: 'function' == typeof test ? (ctx)=>{
|
|
2715
|
+
let info = {
|
|
2716
|
+
moduleGraph: compiler._lastCompilation.moduleGraph,
|
|
2717
|
+
chunkGraph: compiler._lastCompilation.chunkGraph
|
|
2718
|
+
};
|
|
2719
|
+
return test(ctx.module, info);
|
|
2720
|
+
} : test,
|
|
2721
|
+
name: getName(name),
|
|
2722
|
+
chunks: getChunks(chunks),
|
|
2723
|
+
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2724
|
+
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2725
|
+
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2726
|
+
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2727
|
+
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
2728
|
+
...passThrough
|
|
2729
|
+
};
|
|
2730
|
+
}),
|
|
2731
|
+
fallbackCacheGroup: {
|
|
2732
|
+
chunks: getChunks(chunks),
|
|
2733
|
+
...fallbackCacheGroup
|
|
2734
|
+
},
|
|
2735
|
+
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
2736
|
+
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
2737
|
+
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
2738
|
+
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
2739
|
+
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
2740
|
+
...passThrough
|
|
2741
|
+
};
|
|
2742
|
+
}
|
|
2674
2743
|
function applyLimits(options) {
|
|
2675
|
-
options.optimization.concatenateModules = !1, options.optimization.removeEmptyChunks = !1, options.output.chunkFormat = !1, options.output.chunkLoading && 'import' !== options.output.chunkLoading && (options.output.chunkLoading = 'import'), void 0 === options.output.chunkLoading && (options.output.chunkLoading = 'import');
|
|
2744
|
+
options.optimization.concatenateModules = !1, options.optimization.removeEmptyChunks = !1, options.output.chunkFormat = !1, options.output.module = !0, options.output.chunkLoading && 'import' !== options.output.chunkLoading && (options.output.chunkLoading = 'import'), void 0 === options.output.chunkLoading && (options.output.chunkLoading = 'import');
|
|
2676
2745
|
let { splitChunks } = options.optimization;
|
|
2677
2746
|
void 0 === splitChunks && (splitChunks = options.optimization.splitChunks = {}), !1 !== splitChunks && (splitChunks.chunks = 'all', splitChunks.minSize = 0, splitChunks.maxAsyncRequests = 1 / 0, splitChunks.maxInitialRequests = 1 / 0, splitChunks.cacheGroups ??= {}, splitChunks.cacheGroups.default = !1, splitChunks.cacheGroups.defaultVendors = !1);
|
|
2678
2747
|
}
|
|
@@ -2680,7 +2749,7 @@ class EsmLibraryPlugin {
|
|
|
2680
2749
|
static PLUGIN_NAME = 'EsmLibraryPlugin';
|
|
2681
2750
|
options;
|
|
2682
2751
|
constructor(options){
|
|
2683
|
-
this.options = options;
|
|
2752
|
+
this.options = options ?? {};
|
|
2684
2753
|
}
|
|
2685
2754
|
apply(compiler) {
|
|
2686
2755
|
var config;
|
|
@@ -2689,7 +2758,8 @@ class EsmLibraryPlugin {
|
|
|
2689
2758
|
compiler.__internal__registerBuiltinPlugin({
|
|
2690
2759
|
name: binding_namespaceObject.BuiltinPluginName.EsmLibraryPlugin,
|
|
2691
2760
|
options: {
|
|
2692
|
-
preserveModules: this.options
|
|
2761
|
+
preserveModules: this.options.preserveModules,
|
|
2762
|
+
splitChunks: toRawSplitChunksOptions(this.options.splitChunks ?? !1, compiler)
|
|
2693
2763
|
}
|
|
2694
2764
|
});
|
|
2695
2765
|
}
|
|
@@ -4901,7 +4971,7 @@ let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilatio
|
|
|
4901
4971
|
});
|
|
4902
4972
|
}(req);
|
|
4903
4973
|
} catch (err) {
|
|
4904
|
-
logger.error(
|
|
4974
|
+
logger.error(`Failed to parse request body: ${err}`), res.writeHead(400), res.end('Bad Request');
|
|
4905
4975
|
return;
|
|
4906
4976
|
}
|
|
4907
4977
|
let moduleActivated = [];
|
|
@@ -4952,8 +5022,8 @@ let NodeTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.Nod
|
|
|
4952
5022
|
})), OccurrenceChunkIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
|
|
4953
5023
|
...options
|
|
4954
5024
|
}), 'compilation'), ProgressPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ProgressPlugin, (progress = {})=>'function' == typeof progress ? {
|
|
4955
|
-
handler: (percentage, msg,
|
|
4956
|
-
progress(percentage, msg,
|
|
5025
|
+
handler: (percentage, msg, info)=>{
|
|
5026
|
+
progress(percentage, msg, info);
|
|
4957
5027
|
}
|
|
4958
5028
|
} : progress), ProvidePlugin = base_create(binding_namespaceObject.BuiltinPluginName.ProvidePlugin, (provide)=>Object.fromEntries(Object.entries(provide).map(([key, value])=>('string' == typeof value && (value = [
|
|
4959
5029
|
value
|
|
@@ -5080,76 +5150,7 @@ let SideEffectsFlagPlugin = base_create(binding_namespaceObject.BuiltinPluginNam
|
|
|
5080
5150
|
...options,
|
|
5081
5151
|
hints
|
|
5082
5152
|
};
|
|
5083
|
-
}), SourceMapDevToolPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SourceMapDevToolPlugin, (options)=>options, 'compilation')
|
|
5084
|
-
class JsSplitChunkSizes {
|
|
5085
|
-
static __to_binding(sizes) {
|
|
5086
|
-
return 'number' == typeof sizes ? sizes : sizes && 'object' == typeof sizes ? {
|
|
5087
|
-
sizes: sizes
|
|
5088
|
-
} : sizes;
|
|
5089
|
-
}
|
|
5090
|
-
}
|
|
5091
|
-
class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
5092
|
-
options;
|
|
5093
|
-
name = binding_namespaceObject.BuiltinPluginName.SplitChunksPlugin;
|
|
5094
|
-
affectedHooks = 'thisCompilation';
|
|
5095
|
-
constructor(options){
|
|
5096
|
-
super(), this.options = options;
|
|
5097
|
-
}
|
|
5098
|
-
raw(compiler) {
|
|
5099
|
-
let rawOptions = function(sc, compiler) {
|
|
5100
|
-
if (!sc) return;
|
|
5101
|
-
function getName(name) {
|
|
5102
|
-
return 'function' == typeof name ? (ctx)=>void 0 === ctx.module ? name(void 0) : name(ctx.module, getChunks(ctx.chunks), ctx.cacheGroupKey) : name;
|
|
5103
|
-
}
|
|
5104
|
-
function getChunks(chunks) {
|
|
5105
|
-
return 'function' == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
|
5106
|
-
}
|
|
5107
|
-
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
5108
|
-
return {
|
|
5109
|
-
name: getName(name),
|
|
5110
|
-
chunks: getChunks(chunks),
|
|
5111
|
-
defaultSizeTypes: defaultSizeTypes || [
|
|
5112
|
-
"javascript",
|
|
5113
|
-
'unknown'
|
|
5114
|
-
],
|
|
5115
|
-
cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>!1 !== group).map(([key, group])=>{
|
|
5116
|
-
let { test, name, chunks, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
5117
|
-
return {
|
|
5118
|
-
key,
|
|
5119
|
-
test: 'function' == typeof test ? (ctx)=>{
|
|
5120
|
-
let info = {
|
|
5121
|
-
moduleGraph: compiler._lastCompilation.moduleGraph,
|
|
5122
|
-
chunkGraph: compiler._lastCompilation.chunkGraph
|
|
5123
|
-
};
|
|
5124
|
-
return test(ctx.module, info);
|
|
5125
|
-
} : test,
|
|
5126
|
-
name: getName(name),
|
|
5127
|
-
chunks: getChunks(chunks),
|
|
5128
|
-
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
5129
|
-
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
5130
|
-
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
5131
|
-
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
5132
|
-
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
5133
|
-
...passThrough
|
|
5134
|
-
};
|
|
5135
|
-
}),
|
|
5136
|
-
fallbackCacheGroup: {
|
|
5137
|
-
chunks: getChunks(chunks),
|
|
5138
|
-
...fallbackCacheGroup
|
|
5139
|
-
},
|
|
5140
|
-
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
5141
|
-
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
5142
|
-
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
5143
|
-
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
5144
|
-
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
5145
|
-
...passThrough
|
|
5146
|
-
};
|
|
5147
|
-
}(this.options, compiler);
|
|
5148
|
-
if (void 0 === rawOptions) throw Error('rawOptions should not be undefined');
|
|
5149
|
-
return createBuiltinPlugin(this.name, rawOptions);
|
|
5150
|
-
}
|
|
5151
|
-
}
|
|
5152
|
-
let SubresourceIntegrityPlugin_require = createRequire(import.meta.url), SubresourceIntegrityPlugin_PLUGIN_NAME = 'SubresourceIntegrityPlugin', NATIVE_HTML_PLUGIN = 'HtmlRspackPlugin', HTTP_PROTOCOL_REGEX = /^https?:/, NativeSubresourceIntegrityPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
|
5153
|
+
}), SourceMapDevToolPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SourceMapDevToolPlugin, (options)=>options, 'compilation'), SubresourceIntegrityPlugin_require = createRequire(import.meta.url), SubresourceIntegrityPlugin_PLUGIN_NAME = 'SubresourceIntegrityPlugin', NATIVE_HTML_PLUGIN = 'HtmlRspackPlugin', HTTP_PROTOCOL_REGEX = /^https?:/, NativeSubresourceIntegrityPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
|
5153
5154
|
let htmlPlugin = 'Disabled';
|
|
5154
5155
|
return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = 'Native' : 'string' == typeof options.htmlPlugin && (htmlPlugin = 'JavaScript'), {
|
|
5155
5156
|
hashFuncNames: options.hashFuncNames,
|
|
@@ -5352,7 +5353,7 @@ class ContextModuleFactory {
|
|
|
5352
5353
|
};
|
|
5353
5354
|
}
|
|
5354
5355
|
}
|
|
5355
|
-
let FUNCTION_CONTENT_REGEX = /^function\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g, INDENT_MULTILINE_REGEX = /^\t/gm, LINE_SEPARATOR_REGEX = /\r?\n/g, IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/, IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g, COMMENT_END_REGEX = /\*\//g, PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g, MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
|
|
5356
|
+
let FUNCTION_CONTENT_REGEX = /^function(?:\s+[\w$]+)?\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g, INDENT_MULTILINE_REGEX = /^\t/gm, LINE_SEPARATOR_REGEX = /\r?\n/g, IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/, IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g, COMMENT_END_REGEX = /\*\//g, PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g, MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
|
|
5356
5357
|
class Template {
|
|
5357
5358
|
static getFunctionContent(fn) {
|
|
5358
5359
|
return fn.toString().replace(FUNCTION_CONTENT_REGEX, '').replace(INDENT_MULTILINE_REGEX, '').replace(LINE_SEPARATOR_REGEX, '\n');
|
|
@@ -6507,7 +6508,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6507
6508
|
}, applyExperimentsDefaults = (experiments)=>{
|
|
6508
6509
|
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);
|
|
6509
6510
|
}, applyIncrementalDefaults = (options)=>{
|
|
6510
|
-
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, '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));
|
|
6511
|
+
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));
|
|
6511
6512
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
|
|
6512
6513
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6513
6514
|
}, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport })=>{
|
|
@@ -6784,7 +6785,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6784
6785
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6785
6786
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6786
6787
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6787
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.
|
|
6788
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.4"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !output.library));
|
|
6788
6789
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6789
6790
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6790
6791
|
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')));
|
|
@@ -7204,6 +7205,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7204
7205
|
finishModules: !1,
|
|
7205
7206
|
optimizeDependencies: !1,
|
|
7206
7207
|
buildChunkGraph: !0,
|
|
7208
|
+
optimizeChunkModules: !1,
|
|
7207
7209
|
moduleIds: !1,
|
|
7208
7210
|
chunkIds: !1,
|
|
7209
7211
|
modulesHashes: !1,
|
|
@@ -8037,7 +8039,7 @@ class MultiStats {
|
|
|
8037
8039
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8038
8040
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8039
8041
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8040
|
-
}), childOptions.version && (obj.rspackVersion = "2.0.0-beta.
|
|
8042
|
+
}), childOptions.version && (obj.rspackVersion = "2.0.0-beta.4", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8041
8043
|
let mapError = (j, obj)=>({
|
|
8042
8044
|
...obj,
|
|
8043
8045
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8534,7 +8536,7 @@ let arraySum = (array)=>{
|
|
|
8534
8536
|
let str = `${a}`, length = lengths[i];
|
|
8535
8537
|
return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
|
|
8536
8538
|
});
|
|
8537
|
-
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.
|
|
8539
|
+
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
|
|
8538
8540
|
var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
|
8539
8541
|
class NodeEnvironmentPlugin {
|
|
8540
8542
|
options;
|
|
@@ -9296,7 +9298,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9296
9298
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9297
9299
|
},
|
|
9298
9300
|
version: (object)=>{
|
|
9299
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.
|
|
9301
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.4";
|
|
9300
9302
|
},
|
|
9301
9303
|
env: (object, _compilation, _context, { _env })=>{
|
|
9302
9304
|
object.env = _env;
|
|
@@ -10558,18 +10560,21 @@ class RspackOptionsApply {
|
|
|
10558
10560
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
10559
10561
|
namespace: options.output.devtoolNamespace
|
|
10560
10562
|
}).apply(compiler);
|
|
10561
|
-
|
|
10563
|
+
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);
|
|
10564
|
+
let enableLibSplitChunks = !1;
|
|
10565
|
+
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
|
10562
10566
|
let modernModuleCount = 0;
|
|
10563
10567
|
for (let type of options.output.enabledLibraryTypes)'modern-module' === type && modernModuleCount++;
|
|
10564
10568
|
if (options.output.library?.preserveModules && 0 === modernModuleCount) throw Error('preserveModules only works for `modern-module` library type');
|
|
10565
10569
|
if (modernModuleCount > 0) {
|
|
10566
10570
|
if (modernModuleCount !== options.output.enabledLibraryTypes.length) throw Error('`modern-module` cannot used together with other library types');
|
|
10567
|
-
new EsmLibraryPlugin({
|
|
10568
|
-
preserveModules: options.output.library?.preserveModules
|
|
10571
|
+
enableLibSplitChunks = !0, new EsmLibraryPlugin({
|
|
10572
|
+
preserveModules: options.output.library?.preserveModules,
|
|
10573
|
+
splitChunks: options.optimization.splitChunks
|
|
10569
10574
|
}).apply(compiler);
|
|
10570
10575
|
} else for (let type of options.output.enabledLibraryTypes)new EnableLibraryPlugin(type).apply(compiler);
|
|
10571
10576
|
}
|
|
10572
|
-
options.optimization.splitChunks && new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler), options.optimization.removeEmptyChunks && new RemoveEmptyChunksPlugin().apply(compiler), options.optimization.realContentHash && new RealContentHashPlugin().apply(compiler);
|
|
10577
|
+
!enableLibSplitChunks && options.optimization.splitChunks && new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler), options.optimization.removeEmptyChunks && new RemoveEmptyChunksPlugin().apply(compiler), options.optimization.realContentHash && new RealContentHashPlugin().apply(compiler);
|
|
10573
10578
|
let moduleIds = options.optimization.moduleIds;
|
|
10574
10579
|
if (moduleIds) switch(moduleIds){
|
|
10575
10580
|
case 'named':
|
|
@@ -10958,7 +10963,7 @@ class TraceHookPlugin {
|
|
|
10958
10963
|
});
|
|
10959
10964
|
}
|
|
10960
10965
|
}
|
|
10961
|
-
let CORE_VERSION = "2.0.0-beta.
|
|
10966
|
+
let CORE_VERSION = "2.0.0-beta.4", VFILES_BY_COMPILER = new WeakMap();
|
|
10962
10967
|
class VirtualModulesPlugin {
|
|
10963
10968
|
#staticModules;
|
|
10964
10969
|
#compiler;
|
|
@@ -13145,7 +13150,7 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
|
|
|
13145
13150
|
`const __module_federation_library_type__ = ${JSON.stringify(libraryType)}`,
|
|
13146
13151
|
compiler.webpack.Template.getFunctionContent(ModuleFederationPlugin_require('./moduleFederationDefaultRuntime.js').default)
|
|
13147
13152
|
].join(';');
|
|
13148
|
-
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
|
|
13153
|
+
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${encodeURIComponent(content)}`;
|
|
13149
13154
|
}
|
|
13150
13155
|
class ContainerPlugin extends RspackBuiltinPlugin {
|
|
13151
13156
|
name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
|
|
@@ -13242,7 +13247,7 @@ async function transform(source, options) {
|
|
|
13242
13247
|
let _options = JSON.stringify(options || {});
|
|
13243
13248
|
return binding_default().transform(source, _options);
|
|
13244
13249
|
}
|
|
13245
|
-
let exports_rspackVersion = "2.0.0-beta.
|
|
13250
|
+
let exports_rspackVersion = "2.0.0-beta.4", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13246
13251
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13247
13252
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13248
13253
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
package/dist/lib/Cache.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import type { WebpackError } from './WebpackError.js';
|
|
12
12
|
export interface Etag {
|
|
13
13
|
toString(): string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '../../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import type { Callback } from '../../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import WebpackError from './WebpackError.js';
|
|
12
12
|
export declare class HookWebpackError extends WebpackError {
|
|
13
13
|
hook: string;
|
package/dist/rspack.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '../compiled/@rspack/lite-tapable/dist
|
|
10
|
+
import type { Callback } from '../compiled/@rspack/lite-tapable/dist';
|
|
11
11
|
import { Compiler } from './Compiler.js';
|
|
12
12
|
import { type RspackOptions } from './config/index.js';
|
|
13
13
|
import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler.js';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { JsStats, JsStatsCompilation, JsStatsError } from '@rspack/binding';
|
|
11
|
-
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist
|
|
11
|
+
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist';
|
|
12
12
|
import type { Compilation } from '../Compilation.js';
|
|
13
13
|
import { type GroupConfig } from '../util/smartGrouping.js';
|
|
14
14
|
export type KnownStatsFactoryContext = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist
|
|
1
|
+
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist';
|
|
2
2
|
import type { StatsAsset, StatsChunk, StatsChunkGroup, StatsCompilation, StatsModule, StatsModuleReason } from './statsFactoryUtils.js';
|
|
3
3
|
type PrintedElement = {
|
|
4
4
|
element: string;
|