@rspack-debug/core 2.0.0-canary.20260120 → 2.0.0-rc.2
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/README.md +1 -1
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +175 -0
- package/compiled/@rspack/lite-tapable/license +22 -0
- package/compiled/@rspack/lite-tapable/package.json +1 -0
- package/compiled/@swc/types/index.d.ts +15 -9
- package/compiled/@swc/types/package.json +1 -1
- package/compiled/connect-next/index.d.ts +56 -0
- package/compiled/connect-next/license +26 -0
- package/compiled/connect-next/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +544 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/open/index.d.ts +161 -0
- package/compiled/open/package.json +1 -0
- package/compiled/watchpack/index.d.ts +2 -0
- 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/BuildInfo.d.ts +1 -1
- package/dist/Compilation.d.ts +5 -2
- package/dist/Compiler.d.ts +4 -3
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/Module.d.ts +1 -1
- package/dist/ModuleGraph.d.ts +3 -1
- package/dist/ModuleGraphConnection.d.ts +10 -0
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/MultiWatching.d.ts +1 -1
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +1 -2
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/Watching.d.ts +1 -1
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +37 -2
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +4 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
- 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 +3 -3
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -0
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +3 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/devServer.d.ts +102 -237
- package/dist/config/normalization.d.ts +4 -4
- package/dist/config/types.d.ts +184 -71
- package/dist/container/ContainerPlugin.d.ts +3 -2
- package/dist/container/ContainerReferencePlugin.d.ts +4 -3
- package/dist/container/ModuleFederationManifestPlugin.d.ts +10 -3
- package/dist/container/ModuleFederationPlugin.d.ts +20 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
- package/dist/exports.d.ts +17 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1751 -636
- package/dist/lib/Cache.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +1 -1
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +16 -3
- package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +22 -2
- package/dist/sharing/SharePlugin.d.ts +43 -5
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/StatsFactory.d.ts +1 -1
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/swc.d.ts +2 -2
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/source.d.ts +1 -1
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/worker.js +21 -20
- package/hot/dev-server.js +1 -1
- package/hot/emitter.js +0 -2
- package/hot/log.js +0 -2
- package/hot/only-dev-server.js +1 -1
- package/module.d.ts +4 -2
- package/package.json +20 -22
- package/dist/rslib-runtime.js +0 -29
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 '
|
|
10
|
+
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
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 '
|
|
10
|
+
import type { Callback } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
11
11
|
import WebpackError from './WebpackError.js';
|
|
12
12
|
export declare class HookWebpackError extends WebpackError {
|
|
13
13
|
hook: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;export default function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var _ref,_ref1,_ref2,_ref3,_ref4;var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1,_1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};const remotesLoadingChunkMapping=(_ref=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};const initializeSharingScopeToInitDataMapping=(_ref2=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};const consumesLoadingChunkMapping=(_ref3=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};const consumesLoadingModuleToConsumeDataMapping=(_ref4=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey}}return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module)?moduleMap[module]():Promise.resolve().then(()=>{throw new Error('Module "'+module+'" does not exist in container.')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.
|
|
1
|
+
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__,__module_federation_share_fallbacks__,__module_federation_library_type__;export default function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var _ref,_ref1,_ref2,_ref3,_ref4;var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1,_1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};const remotesLoadingChunkMapping=(_ref=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};const initializeSharingScopeToInitDataMapping=(_ref2=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};const consumesLoadingChunkMapping=(_ref3=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};const consumesLoadingModuleToConsumeDataMapping=(_ref4=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"libraryType",()=>__module_federation_library_type__);early(__webpack_require__.federation,"sharedFallback",()=>__module_federation_share_fallbacks__);const sharedFallback=__webpack_require__.federation.sharedFallback;early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){var __webpack_require___federation_bundlerRuntime;consumesLoadingModuleToHandlerMapping[moduleId]={getter:sharedFallback?(__webpack_require___federation_bundlerRuntime=__webpack_require__.federation.bundlerRuntime)===null||__webpack_require___federation_bundlerRuntime===void 0?void 0:__webpack_require___federation_bundlerRuntime.getSharedFallbackGetter({shareKey:data.shareKey,factory:data.fallback,webpackRequire:__webpack_require__,libraryType:__webpack_require__.federation.libraryType}):data.fallback,treeShakingGetter:sharedFallback?data.fallback:undefined,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey,treeShaking:__webpack_require__.federation.sharedFallback?{get:data.fallback,mode:data.treeShakingMode}:undefined}}return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion,treeShakingMode}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory,treeShaking:treeShakingMode?{mode:treeShakingMode}:undefined};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module)?moduleMap[module]():Promise.resolve().then(()=>{throw new Error('Module "'+module+'" does not exist in container.')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.bundlerRuntime.init({webpackRequire:__webpack_require__});if((__webpack_require___consumesLoadingData2=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData2===void 0?void 0:__webpack_require___consumesLoadingData2.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}}
|
|
@@ -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 Watchpack from '../../compiled/watchpack';
|
|
10
|
+
import type Watchpack from '../../compiled/watchpack/index.js';
|
|
11
11
|
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs.js';
|
|
12
12
|
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
13
13
|
inputFileSystem: InputFileSystem;
|
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 '
|
|
10
|
+
import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.js';
|
|
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';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
|
+
import type { Compiler } from '../Compiler.js';
|
|
4
|
+
import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin.js';
|
|
5
|
+
export type CollectSharedEntryPluginOptions = {
|
|
6
|
+
sharedOptions: NormalizedSharedOptions;
|
|
7
|
+
shareScope?: ShareScope;
|
|
8
|
+
};
|
|
9
|
+
export type ShareRequestsMap = Record<string, {
|
|
10
|
+
shareScope: string;
|
|
11
|
+
requests: [string, string][];
|
|
12
|
+
}>;
|
|
13
|
+
export declare class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
|
|
14
|
+
name: BuiltinPluginName;
|
|
15
|
+
sharedOptions: NormalizedSharedOptions;
|
|
16
|
+
private _collectedEntries;
|
|
17
|
+
constructor(options: CollectSharedEntryPluginOptions);
|
|
18
|
+
getData(): ShareRequestsMap;
|
|
19
|
+
getFilename(): string;
|
|
20
|
+
apply(compiler: Compiler): void;
|
|
21
|
+
raw(): BuiltinPlugin;
|
|
22
|
+
}
|
|
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
export type ConsumeSharedPluginOptions = {
|
|
5
5
|
consumes: Consumes;
|
|
6
|
-
shareScope?: string;
|
|
6
|
+
shareScope?: string | string[];
|
|
7
7
|
enhanced?: boolean;
|
|
8
8
|
};
|
|
9
9
|
export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
|
|
@@ -17,22 +17,35 @@ export type ConsumesConfig = {
|
|
|
17
17
|
packageName?: string;
|
|
18
18
|
requiredVersion?: false | string;
|
|
19
19
|
shareKey?: string;
|
|
20
|
-
shareScope?: string;
|
|
20
|
+
shareScope?: string | string[];
|
|
21
21
|
singleton?: boolean;
|
|
22
22
|
strictVersion?: boolean;
|
|
23
|
+
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
23
24
|
};
|
|
25
|
+
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string | string[]): [string, {
|
|
26
|
+
import: string | undefined;
|
|
27
|
+
shareScope: string | string[];
|
|
28
|
+
shareKey: string;
|
|
29
|
+
requiredVersion: string | false | undefined;
|
|
30
|
+
strictVersion: boolean;
|
|
31
|
+
packageName: string | undefined;
|
|
32
|
+
singleton: boolean;
|
|
33
|
+
eager: boolean;
|
|
34
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
35
|
+
}][];
|
|
24
36
|
export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
|
|
25
37
|
name: BuiltinPluginName;
|
|
26
38
|
_options: {
|
|
27
39
|
consumes: [string, {
|
|
28
40
|
import: string | undefined;
|
|
29
|
-
shareScope: string;
|
|
41
|
+
shareScope: string | string[];
|
|
30
42
|
shareKey: string;
|
|
31
43
|
requiredVersion: string | false | undefined;
|
|
32
44
|
strictVersion: boolean;
|
|
33
45
|
packageName: string | undefined;
|
|
34
46
|
singleton: boolean;
|
|
35
47
|
eager: boolean;
|
|
48
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
36
49
|
}][];
|
|
37
50
|
enhanced: boolean;
|
|
38
51
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Compiler } from '../Compiler.js';
|
|
2
|
+
import type { LibraryOptions, Plugins } from '../config/index.js';
|
|
3
|
+
import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin.js';
|
|
4
|
+
import type { Shared, SharedConfig } from './SharePlugin.js';
|
|
5
|
+
export type MakeRequired<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
|
|
6
|
+
export interface IndependentSharePluginOptions {
|
|
7
|
+
name: string;
|
|
8
|
+
shared: Shared;
|
|
9
|
+
library?: LibraryOptions;
|
|
10
|
+
outputDir?: string;
|
|
11
|
+
plugins?: Plugins;
|
|
12
|
+
treeShaking?: boolean;
|
|
13
|
+
manifest?: ModuleFederationManifestPluginOptions;
|
|
14
|
+
injectTreeShakingUsedExports?: boolean;
|
|
15
|
+
treeShakingSharedExcludePlugins?: string[];
|
|
16
|
+
}
|
|
17
|
+
export type ShareFallback = Record<string, [string, string, string][]>;
|
|
18
|
+
export declare class IndependentSharedPlugin {
|
|
19
|
+
mfName: string;
|
|
20
|
+
shared: Shared;
|
|
21
|
+
library?: LibraryOptions;
|
|
22
|
+
sharedOptions: [string, SharedConfig][];
|
|
23
|
+
outputDir: string;
|
|
24
|
+
plugins: Plugins;
|
|
25
|
+
treeShaking?: boolean;
|
|
26
|
+
manifest?: ModuleFederationManifestPluginOptions;
|
|
27
|
+
buildAssets: ShareFallback;
|
|
28
|
+
injectTreeShakingUsedExports?: boolean;
|
|
29
|
+
treeShakingSharedExcludePlugins?: string[];
|
|
30
|
+
name: string;
|
|
31
|
+
constructor(options: IndependentSharePluginOptions);
|
|
32
|
+
apply(compiler: Compiler): void;
|
|
33
|
+
private createIndependentCompilers;
|
|
34
|
+
private createIndependentCompiler;
|
|
35
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
|
+
import type { ShareScope } from './SharePlugin.js';
|
|
4
5
|
export type ProvideSharedPluginOptions<Enhanced extends boolean = false> = {
|
|
5
6
|
provides: Provides<Enhanced>;
|
|
6
|
-
shareScope?:
|
|
7
|
+
shareScope?: ShareScope;
|
|
7
8
|
enhanced?: Enhanced;
|
|
8
9
|
};
|
|
9
10
|
export type Provides<Enhanced extends boolean> = (ProvidesItem | ProvidesObject<Enhanced>)[] | ProvidesObject<Enhanced>;
|
|
@@ -15,7 +16,7 @@ export type ProvidesConfig<Enhanced extends boolean> = Enhanced extends true ? P
|
|
|
15
16
|
type ProvidesV1Config = {
|
|
16
17
|
eager?: boolean;
|
|
17
18
|
shareKey: string;
|
|
18
|
-
shareScope?:
|
|
19
|
+
shareScope?: ShareScope;
|
|
19
20
|
version?: false | string;
|
|
20
21
|
};
|
|
21
22
|
type ProvidesEnhancedConfig = ProvidesV1Config & ProvidesEnhancedExtraConfig;
|
|
@@ -23,7 +24,26 @@ type ProvidesEnhancedExtraConfig = {
|
|
|
23
24
|
singleton?: boolean;
|
|
24
25
|
strictVersion?: boolean;
|
|
25
26
|
requiredVersion?: false | string;
|
|
27
|
+
/**
|
|
28
|
+
* Tree shaking strategy for the shared module.
|
|
29
|
+
*/
|
|
30
|
+
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
26
31
|
};
|
|
32
|
+
export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?: ShareScope, enhanced?: boolean): [string, {
|
|
33
|
+
shareKey: string;
|
|
34
|
+
version: string | false | undefined;
|
|
35
|
+
shareScope: ShareScope;
|
|
36
|
+
eager: boolean;
|
|
37
|
+
} | {
|
|
38
|
+
singleton: boolean | undefined;
|
|
39
|
+
requiredVersion: string | false | undefined;
|
|
40
|
+
strictVersion: boolean | undefined;
|
|
41
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
42
|
+
shareKey: string;
|
|
43
|
+
version: string | false | undefined;
|
|
44
|
+
shareScope: ShareScope;
|
|
45
|
+
eager: boolean;
|
|
46
|
+
}][];
|
|
27
47
|
export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
|
|
28
48
|
name: BuiltinPluginName;
|
|
29
49
|
_provides: [string, Omit<RawProvideOptions, 'key'>][];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Compiler } from '../Compiler.js';
|
|
2
|
+
export type ShareScope = string | string[];
|
|
3
|
+
export declare function validateShareScope(shareScope: ShareScope, enhanced: boolean, pluginName: string): void;
|
|
2
4
|
export type SharePluginOptions = {
|
|
3
|
-
shareScope?:
|
|
5
|
+
shareScope?: ShareScope;
|
|
4
6
|
shared: Shared;
|
|
5
7
|
enhanced: boolean;
|
|
6
8
|
};
|
|
@@ -9,43 +11,79 @@ export type SharedItem = string;
|
|
|
9
11
|
export type SharedObject = {
|
|
10
12
|
[k: string]: SharedConfig | SharedItem;
|
|
11
13
|
};
|
|
14
|
+
export type TreeShakingConfig = {
|
|
15
|
+
usedExports?: string[];
|
|
16
|
+
mode?: 'server-calc' | 'runtime-infer';
|
|
17
|
+
filename?: string;
|
|
18
|
+
};
|
|
12
19
|
export type SharedConfig = {
|
|
13
20
|
eager?: boolean;
|
|
14
21
|
import?: false | SharedItem;
|
|
15
22
|
packageName?: string;
|
|
16
23
|
requiredVersion?: false | string;
|
|
17
24
|
shareKey?: string;
|
|
18
|
-
shareScope?:
|
|
25
|
+
shareScope?: ShareScope;
|
|
19
26
|
singleton?: boolean;
|
|
20
27
|
strictVersion?: boolean;
|
|
21
28
|
version?: false | string;
|
|
29
|
+
treeShaking?: TreeShakingConfig;
|
|
22
30
|
};
|
|
31
|
+
export type NormalizedSharedOptions = [string, SharedConfig][];
|
|
32
|
+
export declare function normalizeSharedOptions(shared: Shared): NormalizedSharedOptions;
|
|
33
|
+
export declare function createProvideShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
|
|
34
|
+
[x: string]: {
|
|
35
|
+
shareKey: string;
|
|
36
|
+
shareScope: ShareScope | undefined;
|
|
37
|
+
version: string | false | undefined;
|
|
38
|
+
eager: boolean | undefined;
|
|
39
|
+
singleton: boolean | undefined;
|
|
40
|
+
requiredVersion: string | false | undefined;
|
|
41
|
+
strictVersion: boolean | undefined;
|
|
42
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
43
|
+
};
|
|
44
|
+
}[];
|
|
45
|
+
export declare function createConsumeShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
|
|
46
|
+
[x: string]: {
|
|
47
|
+
import: string | false | undefined;
|
|
48
|
+
shareKey: string;
|
|
49
|
+
shareScope: ShareScope | undefined;
|
|
50
|
+
requiredVersion: string | false | undefined;
|
|
51
|
+
strictVersion: boolean | undefined;
|
|
52
|
+
singleton: boolean | undefined;
|
|
53
|
+
packageName: string | undefined;
|
|
54
|
+
eager: boolean | undefined;
|
|
55
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
56
|
+
};
|
|
57
|
+
}[];
|
|
23
58
|
export declare class SharePlugin {
|
|
24
|
-
_shareScope:
|
|
59
|
+
_shareScope: ShareScope | undefined;
|
|
25
60
|
_consumes: {
|
|
26
61
|
[x: string]: {
|
|
27
62
|
import: string | false | undefined;
|
|
28
63
|
shareKey: string;
|
|
29
|
-
shareScope:
|
|
64
|
+
shareScope: ShareScope | undefined;
|
|
30
65
|
requiredVersion: string | false | undefined;
|
|
31
66
|
strictVersion: boolean | undefined;
|
|
32
67
|
singleton: boolean | undefined;
|
|
33
68
|
packageName: string | undefined;
|
|
34
69
|
eager: boolean | undefined;
|
|
70
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
35
71
|
};
|
|
36
72
|
}[];
|
|
37
73
|
_provides: {
|
|
38
74
|
[x: string]: {
|
|
39
75
|
shareKey: string;
|
|
40
|
-
shareScope:
|
|
76
|
+
shareScope: ShareScope | undefined;
|
|
41
77
|
version: string | false | undefined;
|
|
42
78
|
eager: boolean | undefined;
|
|
43
79
|
singleton: boolean | undefined;
|
|
44
80
|
requiredVersion: string | false | undefined;
|
|
45
81
|
strictVersion: boolean | undefined;
|
|
82
|
+
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
46
83
|
};
|
|
47
84
|
}[];
|
|
48
85
|
_enhanced: boolean;
|
|
86
|
+
_sharedOptions: NormalizedSharedOptions;
|
|
49
87
|
constructor(options: SharePluginOptions);
|
|
50
88
|
apply(compiler: Compiler): void;
|
|
51
89
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawSharedContainerPluginOptions } from '@rspack/binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
|
+
import type { Compiler } from '../Compiler.js';
|
|
4
|
+
import type { LibraryOptions } from '../config/index.js';
|
|
5
|
+
export type SharedContainerPluginOptions = {
|
|
6
|
+
mfName: string;
|
|
7
|
+
shareName: string;
|
|
8
|
+
version: string;
|
|
9
|
+
request: string;
|
|
10
|
+
library?: LibraryOptions;
|
|
11
|
+
independentShareFileName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class SharedContainerPlugin extends RspackBuiltinPlugin {
|
|
14
|
+
name: BuiltinPluginName;
|
|
15
|
+
filename: string;
|
|
16
|
+
_options: RawSharedContainerPluginOptions;
|
|
17
|
+
_shareName: string;
|
|
18
|
+
_globalName: string;
|
|
19
|
+
constructor(options: SharedContainerPluginOptions);
|
|
20
|
+
getData(): (string | undefined)[];
|
|
21
|
+
raw(compiler: Compiler): BuiltinPlugin;
|
|
22
|
+
apply(compiler: Compiler): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BuiltinPlugin } from '@rspack/binding';
|
|
2
|
+
import { BuiltinPluginName } from '@rspack/binding';
|
|
3
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
4
|
+
import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin.js';
|
|
5
|
+
import type { NormalizedSharedOptions } from './SharePlugin.js';
|
|
6
|
+
export declare class SharedUsedExportsOptimizerPlugin extends RspackBuiltinPlugin {
|
|
7
|
+
name: BuiltinPluginName;
|
|
8
|
+
private sharedOptions;
|
|
9
|
+
private injectTreeShakingUsedExports;
|
|
10
|
+
private manifestOptions;
|
|
11
|
+
constructor(sharedOptions: NormalizedSharedOptions, injectTreeShakingUsedExports?: boolean, manifestOptions?: ModuleFederationManifestPluginOptions);
|
|
12
|
+
private buildOptions;
|
|
13
|
+
raw(): BuiltinPlugin | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Compiler } from '../Compiler.js';
|
|
2
|
+
import type { ModuleFederationPluginOptions } from '../container/ModuleFederationPlugin.js';
|
|
3
|
+
export interface TreeshakingSharedPluginOptions {
|
|
4
|
+
mfConfig: ModuleFederationPluginOptions;
|
|
5
|
+
secondary?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class TreeShakingSharedPlugin {
|
|
8
|
+
mfConfig: ModuleFederationPluginOptions;
|
|
9
|
+
outputDir: string;
|
|
10
|
+
secondary?: boolean;
|
|
11
|
+
private _independentSharePlugin?;
|
|
12
|
+
name: string;
|
|
13
|
+
constructor(options: TreeshakingSharedPluginOptions);
|
|
14
|
+
apply(compiler: Compiler): void;
|
|
15
|
+
get buildAssets(): import("./IndependentSharedPlugin.js").ShareFallback;
|
|
16
|
+
}
|
package/dist/sharing/utils.d.ts
CHANGED
|
@@ -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 '
|
|
11
|
+
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
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 '
|
|
1
|
+
import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
2
2
|
import type { StatsAsset, StatsChunk, StatsChunkGroup, StatsCompilation, StatsModule, StatsModuleReason } from './statsFactoryUtils.js';
|
|
3
3
|
type PrintedElement = {
|
|
4
4
|
element: string;
|
package/dist/swc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TransformOutput } from '@rspack/binding';
|
|
2
|
-
import type { JsMinifyOptions, Options as TransformOptions } from '../compiled/@swc/types';
|
|
3
|
-
export type {
|
|
2
|
+
import type { JsMinifyOptions, Options as TransformOptions } from '../compiled/@swc/types/index.js';
|
|
3
|
+
export type { JsMinifyOptions, TransformOptions, TransformOutput };
|
|
4
4
|
export declare function minify(source: string, options?: JsMinifyOptions): Promise<TransformOutput>;
|
|
5
5
|
export declare function minifySync(source: string, options?: JsMinifyOptions): TransformOutput;
|
|
6
6
|
export declare function transform(source: string, options?: TransformOptions): Promise<TransformOutput>;
|
package/dist/taps/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type binding from '@rspack/binding';
|
|
2
|
-
import type * as liteTapable from '
|
|
2
|
+
import type * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
type CreateHookMapRegisterTaps = <H extends liteTapable.Hook<any, any, any>>(registerKind: binding.RegisterJsTapKind, getHookMap: () => liteTapable.HookMap<H>, createTap: (queried: liteTapable.QueriedHookMap<H>) => any) => (stages: number[]) => binding.JsTap[];
|
|
5
5
|
type CreateHookRegisterTaps = <T, R, A>(registerKind: binding.RegisterJsTapKind, getHook: () => liteTapable.Hook<T, R, A>, createTap: (queried: liteTapable.QueriedHook<T, R, A>) => any) => (stages: number[]) => binding.JsTap[];
|
|
@@ -13,4 +13,4 @@ import Hash from './hash/index.js';
|
|
|
13
13
|
* @param algorithm the algorithm name or a constructor creating a hash
|
|
14
14
|
* @returns the hash
|
|
15
15
|
*/
|
|
16
|
-
export declare const createHash: (algorithm: "
|
|
16
|
+
export declare const createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
|
package/dist/util/source.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsSource } from '@rspack/binding';
|
|
2
|
-
import { type Source } from '../../compiled/webpack-sources';
|
|
2
|
+
import { type Source } from '../../compiled/webpack-sources/types.js';
|
|
3
3
|
export declare class SourceAdapter {
|
|
4
4
|
static fromBinding(source: JsSource): Source;
|
|
5
5
|
static toBinding(source: Source): JsSource;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the current environment supports color output (TTY, FORCE_COLOR, NO_COLOR, etc.).
|
|
3
|
+
* Used as the default for stats.colors when not explicitly set.
|
|
4
|
+
* @see https://github.com/web-infra-dev/rspack/issues/9353
|
|
5
|
+
*/
|
|
6
|
+
export declare function isStatsColorSupported(): boolean;
|
package/dist/worker.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
let createMd4, createXxhash64, url;
|
|
2
|
-
import { createRequire as __rspack_createRequire, createRequire } from "node:module";
|
|
3
|
-
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
4
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
5
2
|
import node_fs from "node:fs";
|
|
6
3
|
import node_querystring from "node:querystring";
|
|
7
4
|
import { inspect, promisify } from "node:util";
|
|
8
5
|
import { receiveMessageOnPort } from "node:worker_threads";
|
|
6
|
+
import { createRequire, createRequire as __rspack_createRequire } from "node:module";
|
|
9
7
|
import node_path from "node:path";
|
|
8
|
+
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
9
|
+
var __webpack_require__ = {};
|
|
10
|
+
__webpack_require__.n = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return __webpack_require__.d(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, __webpack_require__.d = (exports, definition)=>{
|
|
16
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
get: definition[key]
|
|
19
|
+
});
|
|
20
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
21
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
22
|
+
value: 'Module'
|
|
23
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
24
|
+
value: !0
|
|
25
|
+
});
|
|
26
|
+
};
|
|
10
27
|
var swc_namespaceObject = {};
|
|
11
28
|
__webpack_require__.r(swc_namespaceObject), __webpack_require__.d(swc_namespaceObject, {
|
|
12
29
|
minify: ()=>minify,
|
|
@@ -97,7 +114,7 @@ let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(
|
|
|
97
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)=>{
|
|
98
115
|
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
99
116
|
if (void 0 !== firstDynamicInfo) {
|
|
100
|
-
let {
|
|
117
|
+
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
101
118
|
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
102
119
|
let newFn = (...args)=>{
|
|
103
120
|
let fnResult = fn(...args);
|
|
@@ -352,20 +369,6 @@ class BulkUpdateDecorator extends Hash {
|
|
|
352
369
|
return void 0 !== digestCache && 'string' == typeof result && digestCache.set(buffer, result), result;
|
|
353
370
|
}
|
|
354
371
|
}
|
|
355
|
-
class DebugHash extends Hash {
|
|
356
|
-
string;
|
|
357
|
-
constructor(){
|
|
358
|
-
super(), this.string = '';
|
|
359
|
-
}
|
|
360
|
-
update(data) {
|
|
361
|
-
let normalizedData;
|
|
362
|
-
return (normalizedData = Buffer.isBuffer(data) ? data.toString('utf-8') : data).startsWith('debug-digest-') && (normalizedData = Buffer.from(normalizedData.slice(13), 'hex').toString()), this.string += `[${normalizedData}](${Error().stack?.split('\n', 3)[2]})\n`, this;
|
|
363
|
-
}
|
|
364
|
-
digest(encoding) {
|
|
365
|
-
let result = `debug-digest-${Buffer.from(this.string).toString('hex')}`;
|
|
366
|
-
return encoding ? result : Buffer.from(result);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
372
|
class WasmHashAdapter extends Hash {
|
|
370
373
|
wasmHash;
|
|
371
374
|
constructor(wasmHash){
|
|
@@ -381,8 +384,6 @@ class WasmHashAdapter extends Hash {
|
|
|
381
384
|
let createHash_createHash = (algorithm)=>{
|
|
382
385
|
if ('function' == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
|
|
383
386
|
switch(algorithm){
|
|
384
|
-
case 'debug':
|
|
385
|
-
return new DebugHash();
|
|
386
387
|
case 'xxhash64':
|
|
387
388
|
return new WasmHashAdapter((()=>{
|
|
388
389
|
if (!createXxhash64) {
|
package/hot/dev-server.js
CHANGED
|
@@ -28,7 +28,7 @@ if (import.meta.webpackHot) {
|
|
|
28
28
|
);
|
|
29
29
|
log(
|
|
30
30
|
'warning',
|
|
31
|
-
'[HMR] (Probably because of restarting the
|
|
31
|
+
'[HMR] (Probably because of restarting the rspack-dev-server)',
|
|
32
32
|
);
|
|
33
33
|
if (typeof window !== 'undefined') {
|
|
34
34
|
window.location.reload();
|
package/hot/emitter.js
CHANGED
package/hot/log.js
CHANGED
package/hot/only-dev-server.js
CHANGED
|
@@ -22,7 +22,7 @@ if (import.meta.webpackHot) {
|
|
|
22
22
|
log('warning', '[HMR] Cannot find update. Need to do a full reload!');
|
|
23
23
|
log(
|
|
24
24
|
'warning',
|
|
25
|
-
'[HMR] (Probably because of restarting the
|
|
25
|
+
'[HMR] (Probably because of restarting the rspack-dev-server)',
|
|
26
26
|
);
|
|
27
27
|
return;
|
|
28
28
|
}
|
package/module.d.ts
CHANGED
|
@@ -176,7 +176,10 @@ declare namespace Rspack {
|
|
|
176
176
|
id: ModuleId;
|
|
177
177
|
loaded: boolean;
|
|
178
178
|
parents: NodeJS.Module['id'][] | null | undefined;
|
|
179
|
-
|
|
179
|
+
// Keep `any[]` for compatibility:
|
|
180
|
+
// - Rspack runtime uses module ids
|
|
181
|
+
// - `@types/node` defines `children` as `Module[]`.
|
|
182
|
+
children: any[];
|
|
180
183
|
hot?: Hot;
|
|
181
184
|
}
|
|
182
185
|
|
|
@@ -210,7 +213,6 @@ declare namespace Rspack {
|
|
|
210
213
|
interface Process {
|
|
211
214
|
env: {
|
|
212
215
|
[key: string]: any;
|
|
213
|
-
NODE_ENV: 'development' | 'production' | (string & {});
|
|
214
216
|
};
|
|
215
217
|
}
|
|
216
218
|
}
|