@rspack/core 1.0.0-beta.4 → 1.0.0-rc.0
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/Compilation.d.ts +2 -3
- package/dist/Compilation.js +0 -2
- package/dist/Compiler.d.ts +2 -2
- package/dist/Compiler.js +1 -3
- package/dist/MultiCompiler.d.ts +3 -3
- package/dist/MultiCompiler.js +1 -3
- package/dist/NormalModule.d.ts +2 -1
- package/dist/NormalModule.js +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +1 -0
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +41 -10
- package/dist/builtin-plugin/HtmlRspackPlugin.js +16 -4
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +1 -7
- package/dist/builtin-plugin/{SwcCssMinimizerPlugin.d.ts → NoEmitOnErrorsPlugin.d.ts} +3 -9
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.js +6 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -6
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +1 -0
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/loader.js +2 -10
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/builtin-plugin/index.js +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -0
- package/dist/config/adapterRuleUse.js +2 -6
- package/dist/config/defaults.js +14 -7
- package/dist/config/zod.d.ts +8 -0
- package/dist/config/zod.js +2 -1
- package/dist/container/ModuleFederationPlugin.d.ts +1 -0
- package/dist/container/ModuleFederationPlugin.js +1 -0
- package/dist/container/default.runtime.js +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.js +20 -20
- package/dist/lib/EnvironmentPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.js +1 -1
- package/dist/loader-runner/index.js +3 -3
- package/dist/loader-runner/loadLoader.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.js +4 -4
- package/dist/node/NodeWatchFileSystem.d.ts +3 -3
- package/dist/node/NodeWatchFileSystem.js +8 -8
- package/dist/rspackOptionsApply.js +3 -0
- package/dist/util/fs.d.ts +245 -22
- package/package.json +4 -4
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.js +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){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;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _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;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var __webpack_require___remotesLoadingData_chunkMapping;const remotesLoadingChunkMapping=(__webpack_require___remotesLoadingData_chunkMapping=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&__webpack_require___remotesLoadingData_chunkMapping!==void 0?__webpack_require___remotesLoadingData_chunkMapping:{};var __webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping;const remotesLoadingModuleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping!==void 0?__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping:{};var __webpack_require___initializeSharingData_scopeToSharingDataMapping;const initializeSharingScopeToInitDataMapping=(__webpack_require___initializeSharingData_scopeToSharingDataMapping=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&__webpack_require___initializeSharingData_scopeToSharingDataMapping!==void 0?__webpack_require___initializeSharingData_scopeToSharingDataMapping:{};var __webpack_require___consumesLoadingData_chunkMapping;const consumesLoadingChunkMapping=(__webpack_require___consumesLoadingData_chunkMapping=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&__webpack_require___consumesLoadingData_chunkMapping!==void 0?__webpack_require___consumesLoadingData_chunkMapping:{};var __webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping;const consumesLoadingModuleToConsumeDataMapping=(__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping!==void 0?__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens=
|
|
1
|
+
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){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;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _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;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var __webpack_require___remotesLoadingData_chunkMapping;const remotesLoadingChunkMapping=(__webpack_require___remotesLoadingData_chunkMapping=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&__webpack_require___remotesLoadingData_chunkMapping!==void 0?__webpack_require___remotesLoadingData_chunkMapping:{};var __webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping;const remotesLoadingModuleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping!==void 0?__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping:{};var __webpack_require___initializeSharingData_scopeToSharingDataMapping;const initializeSharingScopeToInitDataMapping=(__webpack_require___initializeSharingData_scopeToSharingDataMapping=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&__webpack_require___initializeSharingData_scopeToSharingDataMapping!==void 0?__webpack_require___initializeSharingData_scopeToSharingDataMapping:{};var __webpack_require___consumesLoadingData_chunkMapping;const consumesLoadingChunkMapping=(__webpack_require___consumesLoadingData_chunkMapping=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&__webpack_require___consumesLoadingData_chunkMapping!==void 0?__webpack_require___consumesLoadingData_chunkMapping:{};var __webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping;const consumesLoadingModuleToConsumeDataMapping=(__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping!==void 0?__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping:{};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,"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",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error('Module "'+module1+'" does not exist in container.')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);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})}}};
|
package/dist/exports.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export { EntryPlugin } from "./builtin-plugin";
|
|
|
53
53
|
export { DynamicEntryPlugin } from "./builtin-plugin";
|
|
54
54
|
export { ExternalsPlugin } from "./builtin-plugin";
|
|
55
55
|
export { HotModuleReplacementPlugin } from "./builtin-plugin";
|
|
56
|
+
export { NoEmitOnErrorsPlugin } from "./builtin-plugin";
|
|
56
57
|
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
57
58
|
export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
58
59
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
|
@@ -140,7 +141,6 @@ export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
|
|
|
140
141
|
export type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from "./builtin-plugin";
|
|
141
142
|
export { HtmlRspackPlugin } from "./builtin-plugin";
|
|
142
143
|
export { SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
|
143
|
-
export { SwcCssMinimizerRspackPlugin } from "./builtin-plugin";
|
|
144
144
|
export { LightningCssMinimizerRspackPlugin } from "./builtin-plugin";
|
|
145
145
|
export { CopyRspackPlugin } from "./builtin-plugin";
|
|
146
146
|
export { SourceMapDevToolPlugin } from "./builtin-plugin";
|
package/dist/exports.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.LightningCssMinimizerRspackPlugin = exports.
|
|
29
|
+
exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.LightningCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.web = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.NoEmitOnErrorsPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.Stats = exports.RuntimeGlobals = exports.NormalModule = exports.MultiStats = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compiler = exports.Compilation = exports.version = exports.rspackVersion = void 0;
|
|
30
30
|
exports.experiments = void 0;
|
|
31
31
|
const package_json_1 = require("../package.json");
|
|
32
32
|
// this is a hack to be compatible with plugin which detect webpack's version
|
|
@@ -90,6 +90,8 @@ var builtin_plugin_8 = require("./builtin-plugin");
|
|
|
90
90
|
Object.defineProperty(exports, "ExternalsPlugin", { enumerable: true, get: function () { return builtin_plugin_8.ExternalsPlugin; } });
|
|
91
91
|
var builtin_plugin_9 = require("./builtin-plugin");
|
|
92
92
|
Object.defineProperty(exports, "HotModuleReplacementPlugin", { enumerable: true, get: function () { return builtin_plugin_9.HotModuleReplacementPlugin; } });
|
|
93
|
+
var builtin_plugin_10 = require("./builtin-plugin");
|
|
94
|
+
Object.defineProperty(exports, "NoEmitOnErrorsPlugin", { enumerable: true, get: function () { return builtin_plugin_10.NoEmitOnErrorsPlugin; } });
|
|
93
95
|
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
94
96
|
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
95
97
|
var LoaderOptionsPlugin_1 = require("./lib/LoaderOptionsPlugin");
|
|
@@ -98,38 +100,38 @@ var LoaderTargetPlugin_1 = require("./lib/LoaderTargetPlugin");
|
|
|
98
100
|
Object.defineProperty(exports, "LoaderTargetPlugin", { enumerable: true, get: function () { return LoaderTargetPlugin_1.LoaderTargetPlugin; } });
|
|
99
101
|
var NormalModuleReplacementPlugin_1 = require("./lib/NormalModuleReplacementPlugin");
|
|
100
102
|
Object.defineProperty(exports, "NormalModuleReplacementPlugin", { enumerable: true, get: function () { return NormalModuleReplacementPlugin_1.NormalModuleReplacementPlugin; } });
|
|
101
|
-
const
|
|
103
|
+
const builtin_plugin_11 = require("./builtin-plugin");
|
|
102
104
|
exports.web = {
|
|
103
|
-
FetchCompileAsyncWasmPlugin:
|
|
105
|
+
FetchCompileAsyncWasmPlugin: builtin_plugin_11.FetchCompileAsyncWasmPlugin
|
|
104
106
|
};
|
|
105
|
-
const
|
|
107
|
+
const builtin_plugin_12 = require("./builtin-plugin");
|
|
106
108
|
const NodeEnvironmentPlugin_1 = __importDefault(require("./node/NodeEnvironmentPlugin"));
|
|
107
109
|
const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
|
|
108
110
|
exports.node = {
|
|
109
|
-
NodeTargetPlugin:
|
|
111
|
+
NodeTargetPlugin: builtin_plugin_12.NodeTargetPlugin,
|
|
110
112
|
NodeTemplatePlugin: NodeTemplatePlugin_1.default,
|
|
111
113
|
NodeEnvironmentPlugin: NodeEnvironmentPlugin_1.default
|
|
112
114
|
};
|
|
113
|
-
const builtin_plugin_12 = require("./builtin-plugin");
|
|
114
|
-
exports.electron = { ElectronTargetPlugin: builtin_plugin_12.ElectronTargetPlugin };
|
|
115
115
|
const builtin_plugin_13 = require("./builtin-plugin");
|
|
116
|
-
exports.
|
|
116
|
+
exports.electron = { ElectronTargetPlugin: builtin_plugin_13.ElectronTargetPlugin };
|
|
117
117
|
const builtin_plugin_14 = require("./builtin-plugin");
|
|
118
|
-
exports.
|
|
118
|
+
exports.library = { EnableLibraryPlugin: builtin_plugin_14.EnableLibraryPlugin };
|
|
119
119
|
const builtin_plugin_15 = require("./builtin-plugin");
|
|
120
|
+
exports.wasm = { EnableWasmLoadingPlugin: builtin_plugin_15.EnableWasmLoadingPlugin };
|
|
121
|
+
const builtin_plugin_16 = require("./builtin-plugin");
|
|
120
122
|
exports.javascript = {
|
|
121
|
-
EnableChunkLoadingPlugin:
|
|
122
|
-
JavascriptModulesPlugin:
|
|
123
|
+
EnableChunkLoadingPlugin: builtin_plugin_16.EnableChunkLoadingPlugin,
|
|
124
|
+
JavascriptModulesPlugin: builtin_plugin_16.JavascriptModulesPlugin
|
|
123
125
|
};
|
|
124
|
-
const builtin_plugin_16 = require("./builtin-plugin");
|
|
125
|
-
exports.webworker = { WebWorkerTemplatePlugin: builtin_plugin_16.WebWorkerTemplatePlugin };
|
|
126
126
|
const builtin_plugin_17 = require("./builtin-plugin");
|
|
127
|
+
exports.webworker = { WebWorkerTemplatePlugin: builtin_plugin_17.WebWorkerTemplatePlugin };
|
|
127
128
|
const builtin_plugin_18 = require("./builtin-plugin");
|
|
128
129
|
const builtin_plugin_19 = require("./builtin-plugin");
|
|
130
|
+
const builtin_plugin_20 = require("./builtin-plugin");
|
|
129
131
|
exports.optimize = {
|
|
130
|
-
LimitChunkCountPlugin:
|
|
131
|
-
RuntimeChunkPlugin:
|
|
132
|
-
SplitChunksPlugin:
|
|
132
|
+
LimitChunkCountPlugin: builtin_plugin_18.LimitChunkCountPlugin,
|
|
133
|
+
RuntimeChunkPlugin: builtin_plugin_19.RuntimeChunkPlugin,
|
|
134
|
+
SplitChunksPlugin: builtin_plugin_20.SplitChunksPlugin
|
|
133
135
|
};
|
|
134
136
|
const ModuleFederationPlugin_1 = require("./container/ModuleFederationPlugin");
|
|
135
137
|
const ModuleFederationPluginV1_1 = require("./container/ModuleFederationPluginV1");
|
|
@@ -149,12 +151,10 @@ exports.sharing = {
|
|
|
149
151
|
ConsumeSharedPlugin: ConsumeSharedPlugin_1.ConsumeSharedPlugin,
|
|
150
152
|
SharePlugin: SharePlugin_1.SharePlugin
|
|
151
153
|
};
|
|
152
|
-
var builtin_plugin_20 = require("./builtin-plugin");
|
|
153
|
-
Object.defineProperty(exports, "HtmlRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_20.HtmlRspackPlugin; } });
|
|
154
154
|
var builtin_plugin_21 = require("./builtin-plugin");
|
|
155
|
-
Object.defineProperty(exports, "
|
|
155
|
+
Object.defineProperty(exports, "HtmlRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_21.HtmlRspackPlugin; } });
|
|
156
156
|
var builtin_plugin_22 = require("./builtin-plugin");
|
|
157
|
-
Object.defineProperty(exports, "
|
|
157
|
+
Object.defineProperty(exports, "SwcJsMinimizerRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_22.SwcJsMinimizerRspackPlugin; } });
|
|
158
158
|
var builtin_plugin_23 = require("./builtin-plugin");
|
|
159
159
|
Object.defineProperty(exports, "LightningCssMinimizerRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_23.LightningCssMinimizerRspackPlugin; } });
|
|
160
160
|
var builtin_plugin_24 = require("./builtin-plugin");
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
import type { Compiler } from "../Compiler";
|
|
11
11
|
declare class EnvironmentPlugin {
|
|
12
12
|
keys: string[];
|
|
13
|
-
defaultValues: Record<string, string>;
|
|
14
|
-
constructor(...keys: string[] | [Record<string, string> | string]);
|
|
13
|
+
defaultValues: Record<string, string | undefined | null>;
|
|
14
|
+
constructor(...keys: string[] | [Record<string, string | undefined | null> | string | string[]]);
|
|
15
15
|
/**
|
|
16
16
|
* Apply the plugin
|
|
17
17
|
* @param compiler the compiler instance
|
|
@@ -43,7 +43,7 @@ class EnvironmentPlugin {
|
|
|
43
43
|
: this.defaultValues[key];
|
|
44
44
|
if (value === undefined) {
|
|
45
45
|
compiler.hooks.thisCompilation.tap("EnvironmentPlugin", compilation => {
|
|
46
|
-
const error = new WebpackError_1.default(`EnvironmentPlugin - ${key} environment variable is undefined.\n\nYou can pass an object with default values to suppress this warning.\nSee https://
|
|
46
|
+
const error = new WebpackError_1.default(`EnvironmentPlugin - ${key} environment variable is undefined.\n\nYou can pass an object with default values to suppress this warning.\nSee https://rspack.dev/plugins/webpack/environment-plugin for example.`);
|
|
47
47
|
error.name = "EnvVariableNotDefinedError";
|
|
48
48
|
compilation.errors.push(error);
|
|
49
49
|
});
|
|
@@ -335,7 +335,7 @@ async function runLoaders(compiler, context) {
|
|
|
335
335
|
return new Promise((resolve, reject) => {
|
|
336
336
|
compiler
|
|
337
337
|
._lastCompilation.__internal_getInner()
|
|
338
|
-
.importModule(request, options.publicPath, options.baseUri, context._module.moduleIdentifier, loaderContext.context, (err, res) => {
|
|
338
|
+
.importModule(request, options.layer, options.publicPath, options.baseUri, context._module.moduleIdentifier, loaderContext.context, (err, res) => {
|
|
339
339
|
if (err)
|
|
340
340
|
reject(err);
|
|
341
341
|
else {
|
|
@@ -361,7 +361,7 @@ async function runLoaders(compiler, context) {
|
|
|
361
361
|
}
|
|
362
362
|
return compiler
|
|
363
363
|
._lastCompilation.__internal_getInner()
|
|
364
|
-
.importModule(request, options.publicPath, options.baseUri, context._module.moduleIdentifier, loaderContext.context, (err, res) => {
|
|
364
|
+
.importModule(request, options.layer, options.publicPath, options.baseUri, context._module.moduleIdentifier, loaderContext.context, (err, res) => {
|
|
365
365
|
if (err) {
|
|
366
366
|
callback(err, undefined);
|
|
367
367
|
}
|
|
@@ -613,7 +613,7 @@ async function runLoaders(compiler, context) {
|
|
|
613
613
|
let compilation = compiler._lastCompilation;
|
|
614
614
|
let step = 0;
|
|
615
615
|
while (compilation) {
|
|
616
|
-
NormalModule_1.NormalModule.getCompilationHooks(compilation).loader.call(loaderContext);
|
|
616
|
+
NormalModule_1.NormalModule.getCompilationHooks(compilation).loader.call(loaderContext, loaderContext._module);
|
|
617
617
|
compilation = compilation.compiler.parentCompilation;
|
|
618
618
|
step++;
|
|
619
619
|
if (step > 1000) {
|
|
@@ -20,7 +20,7 @@ function loadLoader(loader, callback) {
|
|
|
20
20
|
if (url === undefined)
|
|
21
21
|
url = require("node:url");
|
|
22
22
|
const loaderUrl = url.pathToFileURL(loader.path);
|
|
23
|
-
const modulePromise =
|
|
23
|
+
const modulePromise = import(loaderUrl.toString());
|
|
24
24
|
modulePromise.then((module) => {
|
|
25
25
|
handleResult(loader, module, callback);
|
|
26
26
|
}, callback);
|
|
@@ -34,15 +34,15 @@ class NodeEnvironmentPlugin {
|
|
|
34
34
|
stream: infrastructureLogging.stream
|
|
35
35
|
})
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const inputFileSystem = new CachedInputFileSystem_1.default(graceful_fs_1.default, 60000);
|
|
38
|
+
compiler.inputFileSystem = inputFileSystem;
|
|
39
39
|
compiler.outputFileSystem = graceful_fs_1.default;
|
|
40
40
|
compiler.intermediateFileSystem = graceful_fs_1.default;
|
|
41
|
-
compiler.watchFileSystem = new NodeWatchFileSystem_1.default(
|
|
41
|
+
compiler.watchFileSystem = new NodeWatchFileSystem_1.default(inputFileSystem);
|
|
42
42
|
compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", compiler => {
|
|
43
43
|
if (compiler.inputFileSystem === inputFileSystem) {
|
|
44
44
|
compiler.fsStartTime = Date.now();
|
|
45
|
-
inputFileSystem.purge();
|
|
45
|
+
inputFileSystem.purge?.();
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import Watchpack from "../../compiled/watchpack";
|
|
11
|
-
import type { FileSystemInfoEntry, WatchFileSystem, Watcher } from "../util/fs";
|
|
11
|
+
import type { FileSystemInfoEntry, InputFileSystem, WatchFileSystem, Watcher } from "../util/fs";
|
|
12
12
|
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
13
|
-
inputFileSystem:
|
|
13
|
+
inputFileSystem: InputFileSystem;
|
|
14
14
|
watcherOptions: Watchpack.WatchOptions;
|
|
15
15
|
watcher: Watchpack;
|
|
16
|
-
constructor(inputFileSystem:
|
|
16
|
+
constructor(inputFileSystem: InputFileSystem);
|
|
17
17
|
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
18
18
|
}
|
|
@@ -63,10 +63,10 @@ class NodeWatchFileSystem {
|
|
|
63
63
|
if (this.inputFileSystem?.purge) {
|
|
64
64
|
const fs = this.inputFileSystem;
|
|
65
65
|
for (const item of changes) {
|
|
66
|
-
fs.purge(item);
|
|
66
|
+
fs.purge?.(item);
|
|
67
67
|
}
|
|
68
68
|
for (const item of removals) {
|
|
69
|
-
fs.purge(item);
|
|
69
|
+
fs.purge?.(item);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
|
@@ -93,20 +93,20 @@ class NodeWatchFileSystem {
|
|
|
93
93
|
},
|
|
94
94
|
getAggregatedRemovals: node_util_1.default.deprecate(() => {
|
|
95
95
|
const items = this.watcher?.aggregatedRemovals;
|
|
96
|
-
if (items && this.inputFileSystem
|
|
96
|
+
if (items && this.inputFileSystem?.purge) {
|
|
97
97
|
const fs = this.inputFileSystem;
|
|
98
98
|
for (const item of items) {
|
|
99
|
-
fs.purge(item);
|
|
99
|
+
fs.purge?.(item);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
return items;
|
|
103
103
|
}, "Watcher.getAggregatedRemovals is deprecated in favor of Watcher.getInfo since that's more performant.", "DEP_WEBPACK_WATCHER_GET_AGGREGATED_REMOVALS"),
|
|
104
104
|
getAggregatedChanges: node_util_1.default.deprecate(() => {
|
|
105
105
|
const items = this.watcher?.aggregatedChanges;
|
|
106
|
-
if (items && this.inputFileSystem
|
|
106
|
+
if (items && this.inputFileSystem?.purge) {
|
|
107
107
|
const fs = this.inputFileSystem;
|
|
108
108
|
for (const item of items) {
|
|
109
|
-
fs.purge(item);
|
|
109
|
+
fs.purge?.(item);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
return items;
|
|
@@ -124,12 +124,12 @@ class NodeWatchFileSystem {
|
|
|
124
124
|
const fs = this.inputFileSystem;
|
|
125
125
|
if (removals) {
|
|
126
126
|
for (const item of removals) {
|
|
127
|
-
fs.purge(item);
|
|
127
|
+
fs.purge?.(item);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
if (changes) {
|
|
131
131
|
for (const item of changes) {
|
|
132
|
-
fs.purge(item);
|
|
132
|
+
fs.purge?.(item);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -96,6 +96,9 @@ class RspackOptionsApply {
|
|
|
96
96
|
if (runtimeChunk) {
|
|
97
97
|
new builtin_plugin_1.RuntimeChunkPlugin(runtimeChunk).apply(compiler);
|
|
98
98
|
}
|
|
99
|
+
if (!options.optimization.emitOnErrors) {
|
|
100
|
+
new builtin_plugin_1.NoEmitOnErrorsPlugin().apply(compiler);
|
|
101
|
+
}
|
|
99
102
|
if (options.devtool) {
|
|
100
103
|
if (options.devtool.includes("source-map")) {
|
|
101
104
|
const hidden = options.devtool.includes("hidden");
|
package/dist/util/fs.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
/// <reference types="node" />
|
|
11
11
|
/// <reference types="node" />
|
|
12
|
+
/// <reference types="node" />
|
|
13
|
+
import type { Abortable } from "node:events";
|
|
12
14
|
import type { WatchOptions } from "../config";
|
|
13
15
|
export interface Watcher {
|
|
14
16
|
close(): void;
|
|
@@ -25,7 +27,7 @@ export interface WatcherInfo {
|
|
|
25
27
|
fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
|
26
28
|
contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
export type IStatsBase<T> = {
|
|
29
31
|
isFile: () => boolean;
|
|
30
32
|
isDirectory: () => boolean;
|
|
31
33
|
isBlockDevice: () => boolean;
|
|
@@ -33,9 +35,33 @@ interface IDirent {
|
|
|
33
35
|
isSymbolicLink: () => boolean;
|
|
34
36
|
isFIFO: () => boolean;
|
|
35
37
|
isSocket: () => boolean;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
dev: T;
|
|
39
|
+
ino: T;
|
|
40
|
+
mode: T;
|
|
41
|
+
nlink: T;
|
|
42
|
+
uid: T;
|
|
43
|
+
gid: T;
|
|
44
|
+
rdev: T;
|
|
45
|
+
size: T;
|
|
46
|
+
blksize: T;
|
|
47
|
+
blocks: T;
|
|
48
|
+
atimeMs: T;
|
|
49
|
+
mtimeMs: T;
|
|
50
|
+
ctimeMs: T;
|
|
51
|
+
birthtimeMs: T;
|
|
52
|
+
atime: Date;
|
|
53
|
+
mtime: Date;
|
|
54
|
+
ctime: Date;
|
|
55
|
+
birthtime: Date;
|
|
56
|
+
};
|
|
57
|
+
export type IStats = IStatsBase<number>;
|
|
58
|
+
export type IBigIntStats = IStatsBase<bigint> & {
|
|
59
|
+
atimeNs: bigint;
|
|
60
|
+
mtimeNs: bigint;
|
|
61
|
+
ctimeNs: bigint;
|
|
62
|
+
birthtimeNs: bigint;
|
|
63
|
+
};
|
|
64
|
+
interface IDirent {
|
|
39
65
|
isFile: () => boolean;
|
|
40
66
|
isDirectory: () => boolean;
|
|
41
67
|
isBlockDevice: () => boolean;
|
|
@@ -43,24 +69,7 @@ interface IStats {
|
|
|
43
69
|
isSymbolicLink: () => boolean;
|
|
44
70
|
isFIFO: () => boolean;
|
|
45
71
|
isSocket: () => boolean;
|
|
46
|
-
|
|
47
|
-
ino: number | bigint;
|
|
48
|
-
mode: number | bigint;
|
|
49
|
-
nlink: number | bigint;
|
|
50
|
-
uid: number | bigint;
|
|
51
|
-
gid: number | bigint;
|
|
52
|
-
rdev: number | bigint;
|
|
53
|
-
size: number | bigint;
|
|
54
|
-
blksize: number | bigint;
|
|
55
|
-
blocks: number | bigint;
|
|
56
|
-
atimeMs: number | bigint;
|
|
57
|
-
mtimeMs: number | bigint;
|
|
58
|
-
ctimeMs: number | bigint;
|
|
59
|
-
birthtimeMs: number | bigint;
|
|
60
|
-
atime: Date;
|
|
61
|
-
mtime: Date;
|
|
62
|
-
ctime: Date;
|
|
63
|
-
birthtime: Date;
|
|
72
|
+
name: string | Buffer;
|
|
64
73
|
}
|
|
65
74
|
export interface OutputFileSystem {
|
|
66
75
|
writeFile: (arg0: string, arg1: string | Buffer, arg2: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
@@ -75,6 +84,220 @@ export interface OutputFileSystem {
|
|
|
75
84
|
relative?: (arg0: string, arg1: string) => string;
|
|
76
85
|
dirname?: (arg0: string) => string;
|
|
77
86
|
}
|
|
87
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
88
|
+
export type JsonArray = JsonValue[];
|
|
89
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
90
|
+
export type JsonObject = {
|
|
91
|
+
[Key in string]: JsonValue;
|
|
92
|
+
} & {
|
|
93
|
+
[Key in string]?: JsonValue | undefined;
|
|
94
|
+
};
|
|
95
|
+
export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
|
|
96
|
+
export type StringCallback = (err: NodeJS.ErrnoException | null, data?: string) => void;
|
|
97
|
+
export type BufferCallback = (err: NodeJS.ErrnoException | null, data?: Buffer) => void;
|
|
98
|
+
export type StringOrBufferCallback = (err: NodeJS.ErrnoException | null, data?: string | Buffer) => void;
|
|
99
|
+
export type ReaddirStringCallback = (err: NodeJS.ErrnoException | null, files?: string[]) => void;
|
|
100
|
+
export type ReaddirBufferCallback = (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void;
|
|
101
|
+
export type ReaddirStringOrBufferCallback = (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void;
|
|
102
|
+
export type ReaddirDirentCallback = (err: NodeJS.ErrnoException | null, files?: IDirent[]) => void;
|
|
103
|
+
export type StatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats) => void;
|
|
104
|
+
export type BigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IBigIntStats) => void;
|
|
105
|
+
export type StatsOrBigIntStatsCallback = (err: NodeJS.ErrnoException | null, stats?: IStats | IBigIntStats) => void;
|
|
106
|
+
export type NumberCallback = (err: NodeJS.ErrnoException | null, data?: number) => void;
|
|
107
|
+
export type ReadJsonCallback = (err: NodeJS.ErrnoException | Error | null, data?: JsonObject) => void;
|
|
108
|
+
export type PathLike = string | Buffer | URL;
|
|
109
|
+
export type PathOrFileDescriptor = PathLike | number;
|
|
110
|
+
export type ObjectEncodingOptions = {
|
|
111
|
+
encoding?: BufferEncoding | null;
|
|
112
|
+
};
|
|
113
|
+
export type ReadFile = {
|
|
114
|
+
(path: PathOrFileDescriptor, options: ({
|
|
115
|
+
encoding: null | undefined;
|
|
116
|
+
flag?: string;
|
|
117
|
+
} & Abortable) | null | undefined, callback: BufferCallback): void;
|
|
118
|
+
(path: PathOrFileDescriptor, options: ({
|
|
119
|
+
encoding: BufferEncoding;
|
|
120
|
+
flag?: string;
|
|
121
|
+
} & Abortable) | BufferEncoding, callback: StringCallback): void;
|
|
122
|
+
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
|
|
123
|
+
flag?: string;
|
|
124
|
+
} & Abortable) | BufferEncoding | null | undefined, callback: StringOrBufferCallback): void;
|
|
125
|
+
(path: PathOrFileDescriptor, callback: BufferCallback): void;
|
|
126
|
+
};
|
|
127
|
+
export type ReadFileSync = {
|
|
128
|
+
(path: PathOrFileDescriptor, options: {
|
|
129
|
+
encoding: null | undefined;
|
|
130
|
+
flag?: string;
|
|
131
|
+
} | null): Buffer;
|
|
132
|
+
(path: PathOrFileDescriptor, options: {
|
|
133
|
+
encoding: BufferEncoding;
|
|
134
|
+
flag?: string;
|
|
135
|
+
} | BufferEncoding): string;
|
|
136
|
+
(path: PathOrFileDescriptor, options: (ObjectEncodingOptions & {
|
|
137
|
+
flag?: string;
|
|
138
|
+
}) | BufferEncoding | null): string | Buffer;
|
|
139
|
+
};
|
|
140
|
+
export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null;
|
|
141
|
+
export type BufferEncodingOption = "buffer" | {
|
|
142
|
+
encoding: "buffer";
|
|
143
|
+
};
|
|
144
|
+
export type StatOptions = {
|
|
145
|
+
bigint?: boolean;
|
|
146
|
+
};
|
|
147
|
+
export type StatSyncOptions = {
|
|
148
|
+
bigint?: boolean;
|
|
149
|
+
throwIfNoEntry?: boolean;
|
|
150
|
+
};
|
|
151
|
+
export type Readlink = {
|
|
152
|
+
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
|
|
153
|
+
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
|
|
154
|
+
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
|
|
155
|
+
(path: PathLike, callback: StringCallback): void;
|
|
156
|
+
};
|
|
157
|
+
export type ReadlinkSync = {
|
|
158
|
+
(path: PathLike, options: EncodingOption): string;
|
|
159
|
+
(path: PathLike, options: BufferEncodingOption): Buffer;
|
|
160
|
+
(path: PathLike, options: EncodingOption): string | Buffer;
|
|
161
|
+
};
|
|
162
|
+
export type Readdir = {
|
|
163
|
+
(path: PathLike, options: {
|
|
164
|
+
encoding: BufferEncoding | null;
|
|
165
|
+
withFileTypes?: false;
|
|
166
|
+
recursive?: boolean;
|
|
167
|
+
} | BufferEncoding | null | undefined, callback: ReaddirStringCallback): void;
|
|
168
|
+
(path: PathLike, options: {
|
|
169
|
+
encoding: "buffer";
|
|
170
|
+
withFileTypes?: false;
|
|
171
|
+
recursive?: boolean;
|
|
172
|
+
} | "buffer", callback: ReaddirBufferCallback): void;
|
|
173
|
+
(path: PathLike, callback: ReaddirStringCallback): void;
|
|
174
|
+
(path: PathLike, options: (ObjectEncodingOptions & {
|
|
175
|
+
withFileTypes: true;
|
|
176
|
+
recursive?: boolean;
|
|
177
|
+
}) | BufferEncoding | null | undefined, callback: ReaddirStringOrBufferCallback): void;
|
|
178
|
+
(path: PathLike, options: ObjectEncodingOptions & {
|
|
179
|
+
withFileTypes: true;
|
|
180
|
+
recursive?: boolean;
|
|
181
|
+
}, callback: ReaddirDirentCallback): void;
|
|
182
|
+
};
|
|
183
|
+
export type ReaddirSync = {
|
|
184
|
+
(path: PathLike, options: {
|
|
185
|
+
encoding: BufferEncoding | null;
|
|
186
|
+
withFileTypes?: false;
|
|
187
|
+
recursive?: boolean;
|
|
188
|
+
} | BufferEncoding | null): string[];
|
|
189
|
+
(path: PathLike, options: {
|
|
190
|
+
encoding: "buffer";
|
|
191
|
+
withFileTypes?: false;
|
|
192
|
+
recursive?: boolean;
|
|
193
|
+
} | "buffer"): Buffer[];
|
|
194
|
+
(path: PathLike, options: (ObjectEncodingOptions & {
|
|
195
|
+
withFileTypes?: false;
|
|
196
|
+
recursive?: boolean;
|
|
197
|
+
}) | BufferEncoding | null): string[] | Buffer[];
|
|
198
|
+
(path: PathLike, options: ObjectEncodingOptions & {
|
|
199
|
+
withFileTypes: true;
|
|
200
|
+
recursive?: boolean;
|
|
201
|
+
}): IDirent[];
|
|
202
|
+
};
|
|
203
|
+
export type Stat = {
|
|
204
|
+
(path: PathLike, callback: StatsCallback): void;
|
|
205
|
+
(path: PathLike, options: (StatOptions & {
|
|
206
|
+
bigint?: false;
|
|
207
|
+
}) | undefined, callback: StatsCallback): void;
|
|
208
|
+
(path: PathLike, options: StatOptions & {
|
|
209
|
+
bigint: true;
|
|
210
|
+
}, callback: BigIntStatsCallback): void;
|
|
211
|
+
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
|
|
212
|
+
};
|
|
213
|
+
export type StatSync = {
|
|
214
|
+
(path: PathLike, options?: undefined): IStats;
|
|
215
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
216
|
+
bigint?: false;
|
|
217
|
+
throwIfNoEntry: false;
|
|
218
|
+
}): IStats | undefined;
|
|
219
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
220
|
+
bigint: true;
|
|
221
|
+
throwIfNoEntry: false;
|
|
222
|
+
}): IBigIntStats | undefined;
|
|
223
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
224
|
+
bigint?: false;
|
|
225
|
+
}): IStats;
|
|
226
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
227
|
+
bigint: true;
|
|
228
|
+
}): IBigIntStats;
|
|
229
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
230
|
+
bigint: boolean;
|
|
231
|
+
throwIfNoEntry?: false;
|
|
232
|
+
}): IStats | IBigIntStats;
|
|
233
|
+
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
|
|
234
|
+
};
|
|
235
|
+
export type LStat = {
|
|
236
|
+
(path: PathLike, callback: StatsCallback): void;
|
|
237
|
+
(path: PathLike, options: (StatOptions & {
|
|
238
|
+
bigint?: false;
|
|
239
|
+
}) | undefined, callback: StatsCallback): void;
|
|
240
|
+
(path: PathLike, options: StatOptions & {
|
|
241
|
+
bigint: true;
|
|
242
|
+
}, callback: BigIntStatsCallback): void;
|
|
243
|
+
(path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
|
|
244
|
+
};
|
|
245
|
+
export type LStatSync = {
|
|
246
|
+
(path: PathLike, options?: undefined): IStats;
|
|
247
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
248
|
+
bigint?: false;
|
|
249
|
+
throwIfNoEntry: false;
|
|
250
|
+
}): IStats | undefined;
|
|
251
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
252
|
+
bigint: true;
|
|
253
|
+
throwIfNoEntry: false;
|
|
254
|
+
}): IBigIntStats | undefined;
|
|
255
|
+
(path: PathLike, options?: StatSyncOptions & {
|
|
256
|
+
bigint?: false;
|
|
257
|
+
}): IStats;
|
|
258
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
259
|
+
bigint: true;
|
|
260
|
+
}): IBigIntStats;
|
|
261
|
+
(path: PathLike, options: StatSyncOptions & {
|
|
262
|
+
bigint: boolean;
|
|
263
|
+
throwIfNoEntry?: false;
|
|
264
|
+
}): IStats | IBigIntStats;
|
|
265
|
+
(path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
|
|
266
|
+
};
|
|
267
|
+
export type RealPath = {
|
|
268
|
+
(path: PathLike, options: EncodingOption, callback: StringCallback): void;
|
|
269
|
+
(path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
|
|
270
|
+
(path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
|
|
271
|
+
(path: PathLike, callback: StringCallback): void;
|
|
272
|
+
};
|
|
273
|
+
export type RealPathSync = {
|
|
274
|
+
(path: PathLike, options?: EncodingOption): string;
|
|
275
|
+
(path: PathLike, options: BufferEncodingOption): Buffer;
|
|
276
|
+
(path: PathLike, options?: EncodingOption): string | Buffer;
|
|
277
|
+
};
|
|
278
|
+
export type ReadJson = (path: PathOrFileDescriptor, callback: ReadJsonCallback) => void;
|
|
279
|
+
export type ReadJsonSync = (path: PathOrFileDescriptor) => JsonObject;
|
|
280
|
+
export type Purge = (files?: string | string[] | Set<string>) => void;
|
|
281
|
+
export type InputFileSystem = {
|
|
282
|
+
readFile: ReadFile;
|
|
283
|
+
readFileSync?: ReadFileSync;
|
|
284
|
+
readlink: Readlink;
|
|
285
|
+
readlinkSync?: ReadlinkSync;
|
|
286
|
+
readdir: Readdir;
|
|
287
|
+
readdirSync?: ReaddirSync;
|
|
288
|
+
stat: Stat;
|
|
289
|
+
statSync?: StatSync;
|
|
290
|
+
lstat?: LStat;
|
|
291
|
+
lstatSync?: LStatSync;
|
|
292
|
+
realpath?: RealPath;
|
|
293
|
+
realpathSync?: RealPathSync;
|
|
294
|
+
readJson?: ReadJson;
|
|
295
|
+
readJsonSync?: ReadJsonSync;
|
|
296
|
+
purge?: Purge;
|
|
297
|
+
join?: (path1: string, path2: string) => string;
|
|
298
|
+
relative?: (from: string, to: string) => string;
|
|
299
|
+
dirname?: (path: string) => string;
|
|
300
|
+
};
|
|
78
301
|
export declare function rmrf(fs: OutputFileSystem, p: string, callback: (err?: Error | null) => void): void;
|
|
79
302
|
export declare const mkdirp: (fs: OutputFileSystem, p: string, callback: (error?: Error) => void) => void;
|
|
80
303
|
export interface FileSystemInfoEntry {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"zod-validation-error": "1.3.1"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@module-federation/runtime-tools": "0.
|
|
61
|
-
"@rspack/lite-tapable": "1.0.0
|
|
60
|
+
"@module-federation/runtime-tools": "0.5.1",
|
|
61
|
+
"@rspack/lite-tapable": "1.0.0",
|
|
62
62
|
"caniuse-lite": "^1.0.30001616",
|
|
63
|
-
"@rspack/binding": "1.0.0-
|
|
63
|
+
"@rspack/binding": "1.0.0-rc.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@swc/helpers": ">=0.5.1"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwcCssMinimizerRspackPlugin = void 0;
|
|
4
|
-
const binding_1 = require("@rspack/binding");
|
|
5
|
-
const base_1 = require("./base");
|
|
6
|
-
exports.SwcCssMinimizerRspackPlugin = (0, base_1.create)(binding_1.BuiltinPluginName.SwcCssMinimizerRspackPlugin, (options) => {
|
|
7
|
-
return {
|
|
8
|
-
test: options?.test,
|
|
9
|
-
include: options?.include,
|
|
10
|
-
exclude: options?.exclude
|
|
11
|
-
};
|
|
12
|
-
});
|