@rspack-canary/browser 1.5.2-canary-a37ca022-20250829094525 → 1.5.3-canary-e5a6ac07-20250908084040
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.
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import type { Compiler } from ".";
|
|
2
|
+
interface ResolvedRequest {
|
|
3
|
+
request: string;
|
|
4
|
+
issuer: string;
|
|
5
|
+
packageName: string;
|
|
6
|
+
}
|
|
7
|
+
interface ProcessedRequest extends ResolvedRequest {
|
|
8
|
+
url: URL;
|
|
9
|
+
}
|
|
2
10
|
interface BrowserHttpImportPluginOptions {
|
|
3
11
|
/**
|
|
4
12
|
* ESM CDN domain
|
|
5
13
|
*/
|
|
6
|
-
domain: string | ((
|
|
14
|
+
domain: string | ((resolvedRequest: ResolvedRequest) => string);
|
|
7
15
|
/**
|
|
8
16
|
* Specify ESM CDN URL for dependencies.
|
|
17
|
+
* If a record is provided, it will be used to map package names to their CDN URLs.
|
|
18
|
+
*
|
|
19
|
+
* Once this function resolves a dependency, other options are ignored.
|
|
9
20
|
*/
|
|
10
|
-
dependencyUrl?: Record<string, string | undefined> | ((
|
|
21
|
+
dependencyUrl?: Record<string, string | undefined> | ((resolvedRequest: ResolvedRequest) => string | undefined);
|
|
11
22
|
/**
|
|
12
23
|
* Specify versions for dependencies.
|
|
13
24
|
* Default to "latest" if not specified.
|
|
14
25
|
*/
|
|
15
26
|
dependencyVersions?: Record<string, string | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* You can attach additional queries supported by the CDN to the `request.url`.
|
|
29
|
+
*
|
|
30
|
+
* For example, to specify the external dependencies under esm.sh, you can do:
|
|
31
|
+
*
|
|
32
|
+
* `request.url.searchParams.set("external", "react,react-dom")`
|
|
33
|
+
*/
|
|
34
|
+
postprocess?: (request: ProcessedRequest) => void;
|
|
16
35
|
}
|
|
17
36
|
/**
|
|
18
37
|
* Convert imports of dependencies in node modules to http imports from esm cdn.
|
|
@@ -21,8 +40,9 @@ export declare class BrowserHttpImportEsmPlugin {
|
|
|
21
40
|
private options;
|
|
22
41
|
constructor(options: BrowserHttpImportPluginOptions);
|
|
23
42
|
apply(compiler: Compiler): void;
|
|
24
|
-
resolveWithUrlIssuer
|
|
25
|
-
resolveNodeModule
|
|
26
|
-
|
|
43
|
+
private resolveWithUrlIssuer;
|
|
44
|
+
private resolveNodeModule;
|
|
45
|
+
private parameterize;
|
|
46
|
+
private isNodeModule;
|
|
27
47
|
}
|
|
28
48
|
export {};
|
package/dist/index.mjs
CHANGED
|
@@ -46704,6 +46704,7 @@ const browserslistTargetHandler_resolve = (browsers)=>{
|
|
|
46704
46704
|
require: nodeProperty
|
|
46705
46705
|
};
|
|
46706
46706
|
};
|
|
46707
|
+
var target_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
46707
46708
|
const getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject);
|
|
46708
46709
|
const hasBrowserslistConfig = (context)=>{
|
|
46709
46710
|
const { findConfig } = __webpack_require__("../../node_modules/.pnpm/browserslist-load-config@1.0.0/node_modules/browserslist-load-config/dist/index.cjs");
|
|
@@ -46724,7 +46725,7 @@ const TARGETS = [
|
|
|
46724
46725
|
(rest, context)=>{
|
|
46725
46726
|
const inlineQuery = rest ? rest.trim() : null;
|
|
46726
46727
|
const browsers = external_rspack_wasi_browser_js_["default"].loadBrowserslist(inlineQuery, context);
|
|
46727
|
-
if (!browsers || !inlineQuery && !hasBrowserslistConfig(context)) throw new Error(`No browserslist config found to handle the 'browserslist' target.
|
|
46728
|
+
if (!browsers || !inlineQuery && !hasBrowserslistConfig(context) && !target_process.env.BROWSERSLIST) throw new Error(`No browserslist config found to handle the 'browserslist' target.
|
|
46728
46729
|
See https://github.com/browserslist/browserslist#queries for possible ways to provide a config.
|
|
46729
46730
|
The recommended way is to add a 'browserslist' key to your package.json and list supported browsers (resp. node.js versions).
|
|
46730
46731
|
You can also more options via the 'target' option: 'browserslist' / 'browserslist:env' / 'browserslist:query' / 'browserslist:path-to-config' / 'browserslist:path-to-config:env'`);
|
|
@@ -47071,7 +47072,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
|
47071
47072
|
if ("object" == typeof rspackFuture) {
|
|
47072
47073
|
D(rspackFuture, "bundlerInfo", {});
|
|
47073
47074
|
if ("object" == typeof rspackFuture.bundlerInfo) {
|
|
47074
|
-
D(rspackFuture.bundlerInfo, "version", "1.5.
|
|
47075
|
+
D(rspackFuture.bundlerInfo, "version", "1.5.3-canary-e5a6ac07-20250908084040");
|
|
47075
47076
|
D(rspackFuture.bundlerInfo, "bundler", "rspack");
|
|
47076
47077
|
D(rspackFuture.bundlerInfo, "force", !library);
|
|
47077
47078
|
}
|
|
@@ -51166,7 +51167,7 @@ class MultiStats {
|
|
|
51166
51167
|
return obj;
|
|
51167
51168
|
});
|
|
51168
51169
|
if (childOptions.version) {
|
|
51169
|
-
obj.rspackVersion = "1.5.
|
|
51170
|
+
obj.rspackVersion = "1.5.3-canary-e5a6ac07-20250908084040";
|
|
51170
51171
|
obj.version = "5.75.0";
|
|
51171
51172
|
}
|
|
51172
51173
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
|
|
@@ -52476,7 +52477,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
52476
52477
|
},
|
|
52477
52478
|
version: (object)=>{
|
|
52478
52479
|
object.version = "5.75.0";
|
|
52479
|
-
object.rspackVersion = "1.5.
|
|
52480
|
+
object.rspackVersion = "1.5.3-canary-e5a6ac07-20250908084040";
|
|
52480
52481
|
},
|
|
52481
52482
|
env: (object, _compilation, _context, { _env })=>{
|
|
52482
52483
|
object.env = _env;
|
|
@@ -56271,6 +56272,7 @@ const getRspackOptionsSchema = memoize(()=>{
|
|
|
56271
56272
|
prefix: schemas_string()
|
|
56272
56273
|
}).partial();
|
|
56273
56274
|
const incremental = strictObject({
|
|
56275
|
+
silent: schemas_boolean(),
|
|
56274
56276
|
make: schemas_boolean(),
|
|
56275
56277
|
inferAsyncModules: schemas_boolean(),
|
|
56276
56278
|
providedExports: schemas_boolean(),
|
|
@@ -56516,21 +56518,10 @@ function getRuntimePlugins(options) {
|
|
|
56516
56518
|
return options.runtimePlugins ?? [];
|
|
56517
56519
|
}
|
|
56518
56520
|
function getPaths(options) {
|
|
56519
|
-
const runtimeToolsPath = options.implementation ?? require.resolve("@module-federation/runtime-tools");
|
|
56520
|
-
const bundlerRuntimePath = require.resolve("@module-federation/webpack-bundler-runtime", {
|
|
56521
|
-
paths: [
|
|
56522
|
-
runtimeToolsPath
|
|
56523
|
-
]
|
|
56524
|
-
});
|
|
56525
|
-
const runtimePath = require.resolve("@module-federation/runtime", {
|
|
56526
|
-
paths: [
|
|
56527
|
-
runtimeToolsPath
|
|
56528
|
-
]
|
|
56529
|
-
});
|
|
56530
56521
|
return {
|
|
56531
|
-
runtimeTools:
|
|
56532
|
-
bundlerRuntime:
|
|
56533
|
-
runtime:
|
|
56522
|
+
runtimeTools: "@module-federation/runtime-tools",
|
|
56523
|
+
bundlerRuntime: "@module-federation/webpack-bundler-runtime",
|
|
56524
|
+
runtime: "@module-federation/runtime"
|
|
56534
56525
|
};
|
|
56535
56526
|
}
|
|
56536
56527
|
function getDefaultEntryRuntime(paths, options, compiler) {
|
|
@@ -56550,7 +56541,7 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
|
56550
56541
|
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
56551
56542
|
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
56552
56543
|
`const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? "version-first")}`,
|
|
56553
|
-
|
|
56544
|
+
'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})}}'
|
|
56554
56545
|
].join(";");
|
|
56555
56546
|
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
|
|
56556
56547
|
}
|
|
@@ -56935,7 +56926,7 @@ function transformSync(source, options) {
|
|
|
56935
56926
|
const _options = JSON.stringify(options || {});
|
|
56936
56927
|
return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
|
|
56937
56928
|
}
|
|
56938
|
-
const exports_rspackVersion = "1.5.
|
|
56929
|
+
const exports_rspackVersion = "1.5.3-canary-e5a6ac07-20250908084040";
|
|
56939
56930
|
const exports_version = "5.75.0";
|
|
56940
56931
|
const exports_WebpackError = Error;
|
|
56941
56932
|
const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
|
|
@@ -57121,30 +57112,31 @@ class BrowserHttpImportEsmPlugin {
|
|
|
57121
57112
|
compiler.hooks.normalModuleFactory.tap("BrowserHttpImportPlugin", (nmf)=>{
|
|
57122
57113
|
nmf.hooks.resolve.tap("BrowserHttpImportPlugin", (resolveData)=>{
|
|
57123
57114
|
const request = resolveData.request;
|
|
57124
|
-
const
|
|
57115
|
+
const issuer = resolveData.contextInfo.issuer;
|
|
57125
57116
|
if (request.includes("!")) return;
|
|
57117
|
+
const issuerUrl = toHttpUrl(issuer);
|
|
57118
|
+
const resolvedRequest = BrowserHttpImportEsmPlugin_resolveRequest(request, issuer, !!issuerUrl);
|
|
57126
57119
|
if (this.options.dependencyUrl) {
|
|
57127
57120
|
if ("function" == typeof this.options.dependencyUrl) {
|
|
57128
|
-
const url = this.options.dependencyUrl(
|
|
57121
|
+
const url = this.options.dependencyUrl(resolvedRequest);
|
|
57129
57122
|
if (url) {
|
|
57130
57123
|
resolveData.request = url;
|
|
57131
57124
|
return;
|
|
57132
57125
|
}
|
|
57133
57126
|
} else if ("object" == typeof this.options.dependencyUrl) {
|
|
57134
|
-
const url = this.options.dependencyUrl[packageName];
|
|
57127
|
+
const url = this.options.dependencyUrl[resolvedRequest.packageName];
|
|
57135
57128
|
if (url) {
|
|
57136
57129
|
resolveData.request = url;
|
|
57137
57130
|
return;
|
|
57138
57131
|
}
|
|
57139
57132
|
}
|
|
57140
57133
|
}
|
|
57141
|
-
const issuerUrl = toHttpUrl(resolveData.contextInfo.issuer);
|
|
57142
57134
|
if (issuerUrl) {
|
|
57143
|
-
resolveData.request = this.resolveWithUrlIssuer(request, issuerUrl);
|
|
57135
|
+
resolveData.request = this.parameterize(this.resolveWithUrlIssuer(request, issuerUrl), resolvedRequest);
|
|
57144
57136
|
return;
|
|
57145
57137
|
}
|
|
57146
57138
|
if (this.isNodeModule(request)) {
|
|
57147
|
-
resolveData.request = this.resolveNodeModule(
|
|
57139
|
+
resolveData.request = this.parameterize(this.resolveNodeModule(resolvedRequest), resolvedRequest);
|
|
57148
57140
|
return;
|
|
57149
57141
|
}
|
|
57150
57142
|
});
|
|
@@ -57153,15 +57145,24 @@ class BrowserHttpImportEsmPlugin {
|
|
|
57153
57145
|
resolveWithUrlIssuer(request, issuer) {
|
|
57154
57146
|
return new URL(request, issuer).href;
|
|
57155
57147
|
}
|
|
57156
|
-
resolveNodeModule(
|
|
57148
|
+
resolveNodeModule(resolvedRequest) {
|
|
57157
57149
|
var _this_options_dependencyVersions;
|
|
57158
57150
|
let domain = "";
|
|
57159
|
-
if ("function" == typeof this.options.domain) domain = this.options.domain(
|
|
57151
|
+
if ("function" == typeof this.options.domain) domain = this.options.domain(resolvedRequest);
|
|
57160
57152
|
else if ("string" == typeof this.options.domain) domain = this.options.domain;
|
|
57161
|
-
const version = (null == (_this_options_dependencyVersions = this.options.dependencyVersions) ? void 0 : _this_options_dependencyVersions[packageName]) || "latest";
|
|
57162
|
-
const versionedRequest = getRequestWithVersion(request, version);
|
|
57153
|
+
const version = (null == (_this_options_dependencyVersions = this.options.dependencyVersions) ? void 0 : _this_options_dependencyVersions[resolvedRequest.packageName]) || "latest";
|
|
57154
|
+
const versionedRequest = getRequestWithVersion(resolvedRequest.request, version);
|
|
57163
57155
|
return `${domain}/${versionedRequest}`;
|
|
57164
57156
|
}
|
|
57157
|
+
parameterize(requestUrl, resolvedRequest) {
|
|
57158
|
+
if (!this.options.postprocess) return requestUrl;
|
|
57159
|
+
const url = new URL(requestUrl);
|
|
57160
|
+
this.options.postprocess({
|
|
57161
|
+
url,
|
|
57162
|
+
...resolvedRequest
|
|
57163
|
+
});
|
|
57164
|
+
return url.toString();
|
|
57165
|
+
}
|
|
57165
57166
|
isNodeModule(request) {
|
|
57166
57167
|
if (toHttpUrl(request)) return false;
|
|
57167
57168
|
return !request.startsWith(".") && !request.startsWith("/") && !request.startsWith("!");
|
|
@@ -57171,12 +57172,34 @@ class BrowserHttpImportEsmPlugin {
|
|
|
57171
57172
|
this.options = options;
|
|
57172
57173
|
}
|
|
57173
57174
|
}
|
|
57174
|
-
function
|
|
57175
|
-
|
|
57176
|
-
|
|
57177
|
-
|
|
57175
|
+
function BrowserHttpImportEsmPlugin_resolveRequest(request, issuer, isHttpIssuer) {
|
|
57176
|
+
function resolvePackageName() {
|
|
57177
|
+
if (isHttpIssuer) {
|
|
57178
|
+
let requestToResolve = request;
|
|
57179
|
+
if (!request.startsWith("/")) requestToResolve = issuer;
|
|
57180
|
+
const segments = requestToResolve.split("/");
|
|
57181
|
+
const nameSegIndex = segments.findIndex((segment)=>segment.includes("@") && !segment.startsWith("@"));
|
|
57182
|
+
if (nameSegIndex > 0) {
|
|
57183
|
+
const nameSeg = segments[nameSegIndex];
|
|
57184
|
+
const atIndex = nameSeg.indexOf("@");
|
|
57185
|
+
const name = nameSeg.slice(0, atIndex);
|
|
57186
|
+
const groupSeg = segments[nameSegIndex - 1] ?? "";
|
|
57187
|
+
if (groupSeg.startsWith("@")) return `${groupSeg}/${name}`;
|
|
57188
|
+
return name;
|
|
57189
|
+
}
|
|
57190
|
+
}
|
|
57191
|
+
if (request.startsWith("@")) {
|
|
57192
|
+
const parts = request.split("/");
|
|
57193
|
+
return `${parts[0]}/${parts[1]}`;
|
|
57194
|
+
}
|
|
57195
|
+
return request.split("/")[0];
|
|
57178
57196
|
}
|
|
57179
|
-
|
|
57197
|
+
const packageName = resolvePackageName();
|
|
57198
|
+
return {
|
|
57199
|
+
packageName,
|
|
57200
|
+
request,
|
|
57201
|
+
issuer
|
|
57202
|
+
};
|
|
57180
57203
|
}
|
|
57181
57204
|
function getRequestWithVersion(request, version) {
|
|
57182
57205
|
if (request.startsWith("@")) {
|
|
Binary file
|
package/dist/schema/config.d.ts
CHANGED
|
@@ -362,6 +362,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
|
362
362
|
css: z.ZodOptional<z.ZodBoolean>;
|
|
363
363
|
layers: z.ZodOptional<z.ZodBoolean>;
|
|
364
364
|
incremental: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"safe">]>, z.ZodLiteral<"advance">]>, z.ZodLiteral<"advance-silent">]>, z.ZodObject<{
|
|
365
|
+
silent: z.ZodOptional<z.ZodBoolean>;
|
|
365
366
|
make: z.ZodOptional<z.ZodBoolean>;
|
|
366
367
|
inferAsyncModules: z.ZodOptional<z.ZodBoolean>;
|
|
367
368
|
providedExports: z.ZodOptional<z.ZodBoolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/browser",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3-canary-e5a6ac07-20250908084040",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",
|