@rspack/browser 2.0.0-rc.0 → 2.0.0-rc.1
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/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 -0
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +14 -3
- package/dist/exports.d.ts +6 -0
- package/dist/index.js +51 -17
- package/dist/napi-binding.d.ts +22 -2
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/wasi-worker-browser.mjs +309 -41
- package/package.json +1 -1
package/dist/ModuleGraph.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Dependency, JsModuleGraph
|
|
1
|
+
import type { Dependency, JsModuleGraph } from './binding';
|
|
2
2
|
import { ExportsInfo } from './ExportsInfo';
|
|
3
|
+
import type { ModuleGraphConnection } from './ModuleGraphConnection';
|
|
3
4
|
import type { Module } from './Module';
|
|
4
5
|
export default class ModuleGraph {
|
|
5
6
|
#private;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CIRCULAR_CONNECTION_SYMBOL, ModuleGraphConnection as BindingModuleGraphConnection, TRANSITIVE_ONLY_SYMBOL } from './binding';
|
|
2
|
+
type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
|
|
3
|
+
readonly TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY_SYMBOL;
|
|
4
|
+
readonly CIRCULAR_CONNECTION: typeof 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 '../binding';
|
|
2
|
+
export declare const HashedModuleIdsPlugin: {
|
|
3
|
+
new (options?: RawHashedModuleIdsPluginOptions | undefined): {
|
|
4
|
+
name: string;
|
|
5
|
+
_args: [options?: RawHashedModuleIdsPluginOptions | undefined];
|
|
6
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
7
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
8
|
+
apply(compiler: import("..").Compiler): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from './base';
|
|
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';
|
|
|
36
36
|
export * from './FileUriPlugin';
|
|
37
37
|
export * from './FlagDependencyExportsPlugin';
|
|
38
38
|
export * from './FlagDependencyUsagePlugin';
|
|
39
|
+
export * from './HashedModuleIdsPlugin';
|
|
39
40
|
export * from './HotModuleReplacementPlugin';
|
|
40
41
|
export * from './HttpExternalsRspackPlugin';
|
|
41
42
|
export * from './HttpUriPlugin';
|
|
@@ -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:
|
|
@@ -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
|
@@ -807,7 +807,6 @@ export type JavascriptParserOptions = {
|
|
|
807
807
|
dynamicImportFetchPriority?: 'low' | 'high' | 'auto';
|
|
808
808
|
/**
|
|
809
809
|
* Enable or disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
|
|
810
|
-
* @default 'preserve-unknown'
|
|
811
810
|
*/
|
|
812
811
|
importMeta?: boolean | 'preserve-unknown';
|
|
813
812
|
/**
|
|
@@ -898,6 +897,11 @@ export type JavascriptParserOptions = {
|
|
|
898
897
|
* @default false
|
|
899
898
|
*/
|
|
900
899
|
importMetaResolve?: boolean;
|
|
900
|
+
/**
|
|
901
|
+
* Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
|
|
902
|
+
* @experimental
|
|
903
|
+
*/
|
|
904
|
+
pureFunctions?: string[];
|
|
901
905
|
};
|
|
902
906
|
export type JsonParserOptions = {
|
|
903
907
|
/**
|
|
@@ -1900,8 +1904,10 @@ export type OptimizationSplitChunksOptions = {
|
|
|
1900
1904
|
export type Optimization = {
|
|
1901
1905
|
/**
|
|
1902
1906
|
* Which algorithm to use when choosing module ids.
|
|
1907
|
+
* Setting to `false` disables the built-in algorithm, allowing a custom plugin
|
|
1908
|
+
* (e.g. HashedModuleIdsPlugin) to provide module ids instead.
|
|
1903
1909
|
*/
|
|
1904
|
-
moduleIds?: 'named' | 'natural' | 'deterministic';
|
|
1910
|
+
moduleIds?: false | 'named' | 'natural' | 'deterministic' | 'hashed';
|
|
1905
1911
|
/**
|
|
1906
1912
|
* Which algorithm to use when choosing chunk ids.
|
|
1907
1913
|
*/
|
|
@@ -2199,6 +2205,11 @@ export type Experiments = {
|
|
|
2199
2205
|
* @default false
|
|
2200
2206
|
*/
|
|
2201
2207
|
deferImport?: boolean;
|
|
2208
|
+
/**
|
|
2209
|
+
* Enable pure-function-based side-effects analysis.
|
|
2210
|
+
* @default false
|
|
2211
|
+
*/
|
|
2212
|
+
pureFunctions?: boolean;
|
|
2202
2213
|
};
|
|
2203
2214
|
export type Watch = boolean;
|
|
2204
2215
|
/** Options for watch mode. */
|
|
@@ -2400,7 +2411,7 @@ export type RspackOptions = {
|
|
|
2400
2411
|
/**
|
|
2401
2412
|
* Configuration for the development server.
|
|
2402
2413
|
*/
|
|
2403
|
-
devServer?: DevServer;
|
|
2414
|
+
devServer?: false | DevServer;
|
|
2404
2415
|
/**
|
|
2405
2416
|
* Options for module configuration.
|
|
2406
2417
|
*/
|
package/dist/exports.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { ExternalModule } from './ExternalModule';
|
|
|
16
16
|
export type { ResolveData, ResourceDataWithData } from './Module';
|
|
17
17
|
export { Module } from './Module';
|
|
18
18
|
export type { default as ModuleGraph } from './ModuleGraph';
|
|
19
|
+
export { ModuleGraphConnection, type ConnectionState, } from './ModuleGraphConnection';
|
|
19
20
|
export { MultiStats } from './MultiStats';
|
|
20
21
|
export { NormalModule } from './NormalModule';
|
|
21
22
|
export type { NormalModuleFactory } from './NormalModuleFactory';
|
|
@@ -76,6 +77,11 @@ interface Electron {
|
|
|
76
77
|
ElectronTargetPlugin: typeof ElectronTargetPlugin;
|
|
77
78
|
}
|
|
78
79
|
export declare const electron: Electron;
|
|
80
|
+
import { HashedModuleIdsPlugin } from './builtin-plugin';
|
|
81
|
+
interface Ids {
|
|
82
|
+
HashedModuleIdsPlugin: typeof HashedModuleIdsPlugin;
|
|
83
|
+
}
|
|
84
|
+
export declare const ids: Ids;
|
|
79
85
|
import { EnableLibraryPlugin } from './builtin-plugin';
|
|
80
86
|
interface Library {
|
|
81
87
|
EnableLibraryPlugin: typeof EnableLibraryPlugin;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! LICENSE: index.js.LICENSE.txt */
|
|
2
|
-
import rspack_wasi_browser, { AsyncDependenciesBlock, BuiltinPluginName as external_rspack_wasi_browser_js_BuiltinPluginName, Chunk, ChunkGraph, Chunks as external_rspack_wasi_browser_js_Chunks, ConcatenatedModule, ContextModule, Dependency, EnforceExtension, EntryDependency, ExternalModule, JsCoordinator, JsLoaderState, JsRspackSeverity, Module, NormalModule, RawRuleSetConditionType, RegisterJsTapKind, ResolverFactory as external_rspack_wasi_browser_js_ResolverFactory, async as external_rspack_wasi_browser_js_async, cleanupGlobalTrace, formatDiagnostic, registerGlobalTrace, sync, syncTraceEvent, transformSync as external_rspack_wasi_browser_js_transformSync } from "./rspack.wasi-browser.js";
|
|
2
|
+
import rspack_wasi_browser, { AsyncDependenciesBlock, BuiltinPluginName as external_rspack_wasi_browser_js_BuiltinPluginName, CIRCULAR_CONNECTION_SYMBOL, Chunk, ChunkGraph, Chunks as external_rspack_wasi_browser_js_Chunks, ConcatenatedModule, ContextModule, Dependency, EnforceExtension, EntryDependency, ExternalModule, JsCoordinator, JsLoaderState, JsRspackSeverity, Module, ModuleGraphConnection, NormalModule, RawRuleSetConditionType, RegisterJsTapKind, ResolverFactory as external_rspack_wasi_browser_js_ResolverFactory, TRANSITIVE_ONLY_SYMBOL, async as external_rspack_wasi_browser_js_async, cleanupGlobalTrace, formatDiagnostic, registerGlobalTrace, sync, syncTraceEvent, transformSync as external_rspack_wasi_browser_js_transformSync } from "./rspack.wasi-browser.js";
|
|
3
3
|
import { AsyncParallelHook, AsyncSeriesBailHook, HookMap, SyncBailHook, SyncHook, SyncWaterfallHook } from "@rspack/lite-tapable";
|
|
4
4
|
import * as __rspack_external__rspack_wasi_browser_js_bd433424 from "./rspack.wasi-browser.js";
|
|
5
5
|
import * as __rspack_external__rspack_lite_tapable_c6bdf810 from "@rspack/lite-tapable";
|
|
@@ -35360,7 +35360,7 @@ __webpack_require__.add({
|
|
|
35360
35360
|
__webpack_require__.d(__webpack_exports__, {
|
|
35361
35361
|
Buffer: ()=>_napi_rs_wasm_runtime_fs__rspack_import_0.hp
|
|
35362
35362
|
});
|
|
35363
|
-
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.
|
|
35363
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35364
35364
|
},
|
|
35365
35365
|
"./src/browser/fs.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
35366
35366
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -35376,15 +35376,15 @@ __webpack_require__.add({
|
|
|
35376
35376
|
volume: ()=>volume,
|
|
35377
35377
|
watch: ()=>watch
|
|
35378
35378
|
});
|
|
35379
|
-
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.
|
|
35380
|
-
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?
|
|
35379
|
+
var _napi_rs_wasm_runtime_fs__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js");
|
|
35380
|
+
var _rspack_binding__rspack_import_1 = __webpack_require__("@rspack/binding?81b3");
|
|
35381
35381
|
const fs = _rspack_binding__rspack_import_1.__fs;
|
|
35382
35382
|
const volume = _rspack_binding__rspack_import_1.__volume;
|
|
35383
35383
|
const memfs = _napi_rs_wasm_runtime_fs__rspack_import_0.tO;
|
|
35384
35384
|
const { readFileSync, readdirSync, lstat, existsSync, readdir, watch } = fs;
|
|
35385
35385
|
const __rspack_default_export = fs;
|
|
35386
35386
|
},
|
|
35387
|
-
"@rspack/binding?
|
|
35387
|
+
"@rspack/binding?81b3" (module) {
|
|
35388
35388
|
module.exports = __rspack_external__rspack_wasi_browser_js_bd433424;
|
|
35389
35389
|
},
|
|
35390
35390
|
"?7763" () {},
|
|
@@ -35404,7 +35404,7 @@ __webpack_require__.add({
|
|
|
35404
35404
|
return out;
|
|
35405
35405
|
};
|
|
35406
35406
|
},
|
|
35407
|
-
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.
|
|
35407
|
+
"../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.1.2_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2/node_modules/@napi-rs/wasm-runtime/dist/fs.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35408
35408
|
__webpack_require__.d(__webpack_exports__, {
|
|
35409
35409
|
hp: ()=>Buffer,
|
|
35410
35410
|
tO: ()=>memfs
|
|
@@ -54032,6 +54032,7 @@ __webpack_require__.d(exports_namespaceObject, {
|
|
|
54032
54032
|
LoaderTargetPlugin: ()=>LoaderTargetPlugin,
|
|
54033
54033
|
Module: ()=>Module,
|
|
54034
54034
|
ModuleFilenameHelpers: ()=>ModuleFilenameHelpers_namespaceObject,
|
|
54035
|
+
ModuleGraphConnection: ()=>ModuleGraphConnection_ModuleGraphConnection,
|
|
54035
54036
|
MultiCompiler: ()=>MultiCompiler,
|
|
54036
54037
|
MultiStats: ()=>MultiStats,
|
|
54037
54038
|
NoEmitOnErrorsPlugin: ()=>NoEmitOnErrorsPlugin,
|
|
@@ -54056,6 +54057,7 @@ __webpack_require__.d(exports_namespaceObject, {
|
|
|
54056
54057
|
container: ()=>container,
|
|
54057
54058
|
electron: ()=>electron,
|
|
54058
54059
|
experiments: ()=>exports_experiments,
|
|
54060
|
+
ids: ()=>ids,
|
|
54059
54061
|
javascript: ()=>javascript,
|
|
54060
54062
|
lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
|
|
54061
54063
|
library: ()=>exports_library,
|
|
@@ -56176,7 +56178,7 @@ const BannerPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginNa
|
|
|
56176
56178
|
const BundlerInfoRspackPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.BundlerInfoRspackPlugin, (options)=>({
|
|
56177
56179
|
version: options.version || 'unknown',
|
|
56178
56180
|
bundler: options.bundler || 'rspack',
|
|
56179
|
-
force: options.force ??
|
|
56181
|
+
force: options.force ?? false
|
|
56180
56182
|
}));
|
|
56181
56183
|
const CaseSensitivePlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.CaseSensitivePlugin, ()=>{}, 'compilation');
|
|
56182
56184
|
const ChunkPrefetchPreloadPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
|
|
@@ -58840,7 +58842,8 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
58840
58842
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
58841
58843
|
jsx: parser.jsx,
|
|
58842
58844
|
deferImport: parser.deferImport,
|
|
58843
|
-
importMetaResolve: parser.importMetaResolve
|
|
58845
|
+
importMetaResolve: parser.importMetaResolve,
|
|
58846
|
+
pureFunctions: parser.pureFunctions
|
|
58844
58847
|
};
|
|
58845
58848
|
}
|
|
58846
58849
|
function getRawAssetParserOptions(parser) {
|
|
@@ -59096,6 +59099,9 @@ class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
|
|
59096
59099
|
return createBuiltinPlugin(this.name, this.global);
|
|
59097
59100
|
}
|
|
59098
59101
|
}
|
|
59102
|
+
const HashedModuleIdsPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.HashedModuleIdsPlugin, (options)=>({
|
|
59103
|
+
...options
|
|
59104
|
+
}), 'compilation');
|
|
59099
59105
|
class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
|
|
59100
59106
|
name = external_rspack_wasi_browser_js_BuiltinPluginName.HotModuleReplacementPlugin;
|
|
59101
59107
|
raw(compiler) {
|
|
@@ -59744,7 +59750,17 @@ const rsc = {
|
|
|
59744
59750
|
ssr: 'server-side-rendering'
|
|
59745
59751
|
}
|
|
59746
59752
|
};
|
|
59747
|
-
|
|
59753
|
+
class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
|
|
59754
|
+
analyzeSideEffectsFree;
|
|
59755
|
+
name = external_rspack_wasi_browser_js_BuiltinPluginName.SideEffectsFlagPlugin;
|
|
59756
|
+
affectedHooks = 'compilation';
|
|
59757
|
+
constructor(analyzeSideEffectsFree = false){
|
|
59758
|
+
super(), this.analyzeSideEffectsFree = analyzeSideEffectsFree;
|
|
59759
|
+
}
|
|
59760
|
+
raw() {
|
|
59761
|
+
return createBuiltinPlugin(this.name, this.analyzeSideEffectsFree);
|
|
59762
|
+
}
|
|
59763
|
+
}
|
|
59748
59764
|
const SizeLimitsPlugin = base_create(external_rspack_wasi_browser_js_BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
|
59749
59765
|
const hints = false === options.hints ? void 0 : options.hints;
|
|
59750
59766
|
return {
|
|
@@ -61408,6 +61424,7 @@ const applyExperimentsDefaults = (experiments)=>{
|
|
|
61408
61424
|
D(experiments, 'buildHttp', void 0);
|
|
61409
61425
|
if (experiments.buildHttp && 'object' == typeof experiments.buildHttp) D(experiments.buildHttp, 'upgrade', false);
|
|
61410
61426
|
D(experiments, 'useInputFileSystem', false);
|
|
61427
|
+
D(experiments, 'pureFunctions', false);
|
|
61411
61428
|
};
|
|
61412
61429
|
const applyIncrementalDefaults = (options)=>{
|
|
61413
61430
|
D(options, 'incremental', {});
|
|
@@ -61834,9 +61851,9 @@ const applyOutputDefaults = (options, { context, targetProperties: tp, isAffecte
|
|
|
61834
61851
|
});
|
|
61835
61852
|
D(output, 'bundlerInfo', {});
|
|
61836
61853
|
if ('object' == typeof output.bundlerInfo) {
|
|
61837
|
-
D(output.bundlerInfo, 'version', "2.0.0-rc.
|
|
61854
|
+
D(output.bundlerInfo, 'version', "2.0.0-rc.1");
|
|
61838
61855
|
D(output.bundlerInfo, 'bundler', 'rspack');
|
|
61839
|
-
D(output.bundlerInfo, 'force',
|
|
61856
|
+
D(output.bundlerInfo, 'force', false);
|
|
61840
61857
|
}
|
|
61841
61858
|
};
|
|
61842
61859
|
const applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
@@ -63491,7 +63508,7 @@ class MultiStats {
|
|
|
63491
63508
|
return obj;
|
|
63492
63509
|
});
|
|
63493
63510
|
if (childOptions.version) {
|
|
63494
|
-
obj.rspackVersion = "2.0.0-rc.
|
|
63511
|
+
obj.rspackVersion = "2.0.0-rc.1";
|
|
63495
63512
|
obj.version = "5.75.0";
|
|
63496
63513
|
}
|
|
63497
63514
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join('');
|
|
@@ -65177,7 +65194,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
65177
65194
|
},
|
|
65178
65195
|
version: (object)=>{
|
|
65179
65196
|
object.version = "5.75.0";
|
|
65180
|
-
object.rspackVersion = "2.0.0-rc.
|
|
65197
|
+
object.rspackVersion = "2.0.0-rc.1";
|
|
65181
65198
|
},
|
|
65182
65199
|
env: (object, _compilation, _context, { _env })=>{
|
|
65183
65200
|
object.env = _env;
|
|
@@ -66754,7 +66771,7 @@ class RspackOptionsApply {
|
|
|
66754
66771
|
if (options.experiments.buildHttp) new HttpUriPlugin(options.experiments.buildHttp).apply(compiler);
|
|
66755
66772
|
new EnsureChunkConditionsPlugin().apply(compiler);
|
|
66756
66773
|
if (options.optimization.mergeDuplicateChunks) new MergeDuplicateChunksPlugin().apply(compiler);
|
|
66757
|
-
if (options.optimization.sideEffects) new SideEffectsFlagPlugin().apply(compiler);
|
|
66774
|
+
if (options.optimization.sideEffects) new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler);
|
|
66758
66775
|
if (options.optimization.providedExports) new FlagDependencyExportsPlugin().apply(compiler);
|
|
66759
66776
|
if (options.optimization.usedExports) new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler);
|
|
66760
66777
|
if (options.optimization.concatenateModules) new ModuleConcatenationPlugin().apply(compiler);
|
|
@@ -66791,6 +66808,9 @@ class RspackOptionsApply {
|
|
|
66791
66808
|
case 'deterministic':
|
|
66792
66809
|
new DeterministicModuleIdsPlugin().apply(compiler);
|
|
66793
66810
|
break;
|
|
66811
|
+
case 'hashed':
|
|
66812
|
+
new HashedModuleIdsPlugin().apply(compiler);
|
|
66813
|
+
break;
|
|
66794
66814
|
default:
|
|
66795
66815
|
throw new Error(`moduleIds: ${moduleIds} is not implemented`);
|
|
66796
66816
|
}
|
|
@@ -68420,7 +68440,7 @@ class Compiler {
|
|
|
68420
68440
|
const rawOptions = getRawOptions(options, this);
|
|
68421
68441
|
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
|
68422
68442
|
rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
68423
|
-
const instanceBinding = __webpack_require__("@rspack/binding?
|
|
68443
|
+
const instanceBinding = __webpack_require__("@rspack/binding?81b3");
|
|
68424
68444
|
this.#registers = this.#createHooksRegisters();
|
|
68425
68445
|
const inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
|
68426
68446
|
try {
|
|
@@ -68627,6 +68647,17 @@ Object.defineProperty(rspack_wasi_browser.ExternalModule.prototype, 'emitFile',
|
|
|
68627
68647
|
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
68628
68648
|
}
|
|
68629
68649
|
});
|
|
68650
|
+
const ModuleGraphConnection_ModuleGraphConnection = ModuleGraphConnection;
|
|
68651
|
+
Object.defineProperties(ModuleGraphConnection_ModuleGraphConnection, {
|
|
68652
|
+
TRANSITIVE_ONLY: {
|
|
68653
|
+
value: TRANSITIVE_ONLY_SYMBOL,
|
|
68654
|
+
enumerable: true
|
|
68655
|
+
},
|
|
68656
|
+
CIRCULAR_CONNECTION: {
|
|
68657
|
+
value: CIRCULAR_CONNECTION_SYMBOL,
|
|
68658
|
+
enumerable: true
|
|
68659
|
+
}
|
|
68660
|
+
});
|
|
68630
68661
|
const asRegExp = (test)=>{
|
|
68631
68662
|
if ('string' == typeof test) return new RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}`);
|
|
68632
68663
|
return test;
|
|
@@ -69985,7 +70016,7 @@ function transformSync(source, options) {
|
|
|
69985
70016
|
const _options = JSON.stringify(options || {});
|
|
69986
70017
|
return rspack_wasi_browser.transformSync(source, _options);
|
|
69987
70018
|
}
|
|
69988
|
-
const exports_rspackVersion = "2.0.0-rc.
|
|
70019
|
+
const exports_rspackVersion = "2.0.0-rc.1";
|
|
69989
70020
|
const exports_version = "5.75.0";
|
|
69990
70021
|
const exports_WebpackError = Error;
|
|
69991
70022
|
const exports_config = {
|
|
@@ -70009,6 +70040,9 @@ const exports_node = {
|
|
|
70009
70040
|
const electron = {
|
|
70010
70041
|
ElectronTargetPlugin: ElectronTargetPlugin
|
|
70011
70042
|
};
|
|
70043
|
+
const ids = {
|
|
70044
|
+
HashedModuleIdsPlugin: HashedModuleIdsPlugin
|
|
70045
|
+
};
|
|
70012
70046
|
const exports_library = {
|
|
70013
70047
|
EnableLibraryPlugin: EnableLibraryPlugin
|
|
70014
70048
|
};
|
|
@@ -70246,4 +70280,4 @@ const builtinMemFs = {
|
|
|
70246
70280
|
volume: fs_0.volume,
|
|
70247
70281
|
memfs: fs_0.memfs
|
|
70248
70282
|
};
|
|
70249
|
-
export { AsyncDependenciesBlock, BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, 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, builtinMemFs, 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, 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, webpack_sources_lib as sources, webworker };
|
|
70283
|
+
export { AsyncDependenciesBlock, BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, 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_ModuleGraphConnection as ModuleGraphConnection, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, builtinMemFs, 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, ids, 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, webpack_sources_lib as sources, webworker };
|
package/dist/napi-binding.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
|
|
|
25
25
|
|
|
26
26
|
export const RUST_ERROR_SYMBOL: unique symbol;
|
|
27
27
|
|
|
28
|
+
export const CIRCULAR_CONNECTION_SYMBOL: unique symbol;
|
|
29
|
+
export const TRANSITIVE_ONLY_SYMBOL: unique symbol;
|
|
30
|
+
export type ConnectionState = boolean | typeof CIRCULAR_CONNECTION_SYMBOL | typeof TRANSITIVE_ONLY_SYMBOL;
|
|
31
|
+
|
|
28
32
|
interface KnownBuildInfo {
|
|
29
33
|
[BUILD_INFO_ASSETS_SYMBOL]: Assets,
|
|
30
34
|
[BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
|
|
@@ -452,6 +456,7 @@ export declare class ModuleGraphConnection {
|
|
|
452
456
|
get module(): Module | null
|
|
453
457
|
get resolvedModule(): Module | null
|
|
454
458
|
get originModule(): Module | null
|
|
459
|
+
getActiveState(runtime: string | string[] | undefined): ConnectionState
|
|
455
460
|
}
|
|
456
461
|
|
|
457
462
|
export declare class NativeWatcher {
|
|
@@ -561,6 +566,7 @@ export declare enum BuiltinPluginName {
|
|
|
561
566
|
NamedModuleIdsPlugin = 'NamedModuleIdsPlugin',
|
|
562
567
|
NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin',
|
|
563
568
|
DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin',
|
|
569
|
+
HashedModuleIdsPlugin = 'HashedModuleIdsPlugin',
|
|
564
570
|
NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
|
|
565
571
|
NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
|
|
566
572
|
DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin',
|
|
@@ -2234,6 +2240,7 @@ export interface RawExperiments {
|
|
|
2234
2240
|
useInputFileSystem?: false | Array<RegExp>
|
|
2235
2241
|
css?: boolean
|
|
2236
2242
|
deferImport: boolean
|
|
2243
|
+
pureFunctions: boolean
|
|
2237
2244
|
}
|
|
2238
2245
|
|
|
2239
2246
|
export interface RawExposeOptions {
|
|
@@ -2308,6 +2315,13 @@ export interface RawGeneratorOptions {
|
|
|
2308
2315
|
json?: RawJsonGeneratorOptions
|
|
2309
2316
|
}
|
|
2310
2317
|
|
|
2318
|
+
export interface RawHashedModuleIdsPluginOptions {
|
|
2319
|
+
context?: string
|
|
2320
|
+
hashFunction?: string
|
|
2321
|
+
hashDigest?: string
|
|
2322
|
+
hashDigestLength?: number
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2311
2325
|
export interface RawHtmlRspackPluginBaseOptions {
|
|
2312
2326
|
href?: string
|
|
2313
2327
|
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
@@ -2469,6 +2483,12 @@ jsx?: boolean
|
|
|
2469
2483
|
* @experimental
|
|
2470
2484
|
*/
|
|
2471
2485
|
importMetaResolve?: boolean
|
|
2486
|
+
/**
|
|
2487
|
+
* Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
|
|
2488
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2489
|
+
* @experimental
|
|
2490
|
+
*/
|
|
2491
|
+
pureFunctions?: Array<string>
|
|
2472
2492
|
}
|
|
2473
2493
|
|
|
2474
2494
|
export interface RawJsonGeneratorOptions {
|
|
@@ -2894,10 +2914,10 @@ export interface RawRslibPluginOptions {
|
|
|
2894
2914
|
*/
|
|
2895
2915
|
forceNodeShims?: boolean
|
|
2896
2916
|
/**
|
|
2897
|
-
*
|
|
2917
|
+
* Auto downgrade module external type to node-commonjs for CJS require of node builtins
|
|
2898
2918
|
* @default `false`
|
|
2899
2919
|
*/
|
|
2900
|
-
|
|
2920
|
+
autoCjsNodeBuiltin?: boolean
|
|
2901
2921
|
}
|
|
2902
2922
|
|
|
2903
2923
|
export interface RawRstestPluginOptions {
|
|
Binary file
|