@rspack-canary/core 1.6.0-canary-6cd722f4-20251022123039 → 1.6.0-canary-e28e40e9-20251022173516
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/cssExtractHmr.js +31 -34
- package/dist/index.js +5 -5
- package/dist/util/fs.d.ts +23 -0
- package/package.json +3 -3
package/dist/cssExtractHmr.js
CHANGED
|
@@ -14,9 +14,9 @@ __webpack_require__.d = (exports1, definition)=>{
|
|
|
14
14
|
};
|
|
15
15
|
var __webpack_exports__ = {};
|
|
16
16
|
function normalizeUrl(url) {
|
|
17
|
-
|
|
17
|
+
var urlString = url.trim();
|
|
18
18
|
if (/^data:/i.test(urlString)) return urlString;
|
|
19
|
-
|
|
19
|
+
var protocol = -1 !== urlString.indexOf("//") ? "".concat(urlString.split("//")[0], "//") : "", components = urlString.replace(RegExp(protocol, "i"), "").split("/"), host = components[0].toLowerCase().replace(/\.$/, "");
|
|
20
20
|
return components[0] = "", protocol + host + components.reduce((accumulator, item)=>{
|
|
21
21
|
switch(item){
|
|
22
22
|
case "..":
|
|
@@ -34,29 +34,29 @@ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_expo
|
|
|
34
34
|
cssReload: ()=>cssReload,
|
|
35
35
|
normalizeUrl: ()=>normalizeUrl
|
|
36
36
|
});
|
|
37
|
-
|
|
37
|
+
var srcByModuleId = Object.create(null), noDocument = "undefined" == typeof document, { forEach } = Array.prototype;
|
|
38
38
|
function noop() {}
|
|
39
39
|
function updateCss(el, url) {
|
|
40
|
-
let normalizedUrl;
|
|
41
40
|
if (url) normalizedUrl = url;
|
|
42
41
|
else {
|
|
43
|
-
|
|
42
|
+
var normalizedUrl, href = el.getAttribute("href");
|
|
44
43
|
if (!href) return;
|
|
45
44
|
normalizedUrl = href.split("?")[0];
|
|
46
45
|
}
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
if (isUrlRequest(el.href) && !1 !== el.isLoaded && normalizedUrl && normalizedUrl.indexOf(".css") > -1) {
|
|
47
|
+
el.visited = !0;
|
|
48
|
+
var newEl = el.cloneNode();
|
|
49
|
+
newEl.isLoaded = !1, newEl.addEventListener("load", ()=>{
|
|
50
|
+
!newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
|
|
51
|
+
}), newEl.addEventListener("error", ()=>{
|
|
52
|
+
!newEl.isLoaded && (newEl.isLoaded = !0, el.parentNode && el.parentNode.removeChild(el));
|
|
53
|
+
}), newEl.href = "".concat(normalizedUrl, "?").concat(Date.now());
|
|
54
|
+
var parent = el.parentNode;
|
|
55
|
+
parent && (el.nextSibling ? parent.insertBefore(newEl, el.nextSibling) : parent.appendChild(newEl));
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
function reloadAll() {
|
|
59
|
-
|
|
59
|
+
var elements = document.querySelectorAll("link");
|
|
60
60
|
forEach.call(elements, (el)=>{
|
|
61
61
|
!0 !== el.visited && updateCss(el);
|
|
62
62
|
});
|
|
@@ -65,42 +65,39 @@ function isUrlRequest(url) {
|
|
|
65
65
|
return !!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url);
|
|
66
66
|
}
|
|
67
67
|
function cssReload(moduleId, options) {
|
|
68
|
-
var fn;
|
|
69
|
-
let timeout;
|
|
70
68
|
if (noDocument) return console.log("[HMR] No `window.document` found, CSS HMR disabled"), noop;
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
var fn, timeout, getScriptSrc = function(moduleId) {
|
|
70
|
+
var src = srcByModuleId[moduleId];
|
|
73
71
|
if (!src) {
|
|
74
72
|
if (document.currentScript) ({ src } = document.currentScript);
|
|
75
73
|
else {
|
|
76
|
-
|
|
74
|
+
var scripts = document.getElementsByTagName("script"), lastScriptTag = scripts[scripts.length - 1];
|
|
77
75
|
lastScriptTag && ({ src } = lastScriptTag);
|
|
78
76
|
}
|
|
79
77
|
srcByModuleId[moduleId] = src;
|
|
80
78
|
}
|
|
81
79
|
return (fileMap)=>{
|
|
82
80
|
if (!src) return null;
|
|
83
|
-
|
|
81
|
+
var splitResult = src.match(/([^\\/]+)\.js$/), filename = splitResult && splitResult[1];
|
|
84
82
|
return filename && fileMap ? fileMap.split(",").map((mapRule)=>{
|
|
85
|
-
|
|
86
|
-
return normalizeUrl(src.replace(reg,
|
|
83
|
+
var reg = RegExp("".concat(filename, "\\.js$"), "g");
|
|
84
|
+
return normalizeUrl(src.replace(reg, "".concat(mapRule.replace(/{fileName}/g, filename), ".css")));
|
|
87
85
|
}) : [
|
|
88
86
|
src.replace(".js", ".css")
|
|
89
87
|
];
|
|
90
88
|
};
|
|
91
89
|
}(moduleId);
|
|
92
90
|
return fn = function() {
|
|
93
|
-
|
|
91
|
+
var src = getScriptSrc(options.filename), reloaded = function(src) {
|
|
94
92
|
if (!src) return !1;
|
|
95
|
-
|
|
93
|
+
var elements = document.querySelectorAll("link"), loaded = !1;
|
|
96
94
|
return forEach.call(elements, (el)=>{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
!isUrlRequest(url) || !0 !== el.visited && url && (updateCss(el, url), loaded = !0);
|
|
95
|
+
if (el.href) {
|
|
96
|
+
var href, ret, normalizedHref, url = (href = el.href, ret = "", normalizedHref = normalizeUrl(href), src.some((url)=>{
|
|
97
|
+
normalizedHref.indexOf(src) > -1 && (ret = url);
|
|
98
|
+
}), ret);
|
|
99
|
+
!isUrlRequest(url) || !0 !== el.visited && url && (updateCss(el, url), loaded = !0);
|
|
100
|
+
}
|
|
104
101
|
}), loaded;
|
|
105
102
|
}(src);
|
|
106
103
|
if (options.locals) {
|
|
@@ -110,7 +107,7 @@ function cssReload(moduleId, options) {
|
|
|
110
107
|
reloaded ? console.log("[HMR] CSS reload %s", src && src.join(" ")) : (console.log("[HMR] Reload all CSS"), reloadAll());
|
|
111
108
|
}, timeout = 0, function() {
|
|
112
109
|
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
|
113
|
-
|
|
110
|
+
var self = this;
|
|
114
111
|
clearTimeout(timeout), timeout = setTimeout(function() {
|
|
115
112
|
return fn.apply(self, args);
|
|
116
113
|
}, 50);
|
package/dist/index.js
CHANGED
|
@@ -5718,7 +5718,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5718
5718
|
}, applyExperimentsDefaults = (experiments, { development })=>{
|
|
5719
5719
|
F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
|
|
5720
5720
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
5721
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-
|
|
5721
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.0-canary-e28e40e9-20251022173516"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
|
5722
5722
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
|
|
5723
5723
|
if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { usedExports, inlineConst, deferImport })=>{
|
|
5724
5724
|
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
|
@@ -7364,7 +7364,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7364
7364
|
});
|
|
7365
7365
|
}
|
|
7366
7366
|
}
|
|
7367
|
-
let CORE_VERSION = "1.6.0-canary-
|
|
7367
|
+
let CORE_VERSION = "1.6.0-canary-e28e40e9-20251022173516", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
|
7368
7368
|
|
|
7369
7369
|
Help:
|
|
7370
7370
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
|
@@ -8655,7 +8655,7 @@ Help:
|
|
|
8655
8655
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8656
8656
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8657
8657
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8658
|
-
}), childOptions.version && (obj.rspackVersion = "1.6.0-canary-
|
|
8658
|
+
}), childOptions.version && (obj.rspackVersion = "1.6.0-canary-e28e40e9-20251022173516", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
|
8659
8659
|
let mapError = (j, obj)=>({
|
|
8660
8660
|
...obj,
|
|
8661
8661
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -9554,7 +9554,7 @@ Help:
|
|
|
9554
9554
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9555
9555
|
},
|
|
9556
9556
|
version: (object)=>{
|
|
9557
|
-
object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-
|
|
9557
|
+
object.version = "5.75.0", object.rspackVersion = "1.6.0-canary-e28e40e9-20251022173516";
|
|
9558
9558
|
},
|
|
9559
9559
|
env: (object, _compilation, _context, { _env })=>{
|
|
9560
9560
|
object.env = _env;
|
|
@@ -11658,7 +11658,7 @@ Help:
|
|
|
11658
11658
|
let _options = JSON.stringify(options || {});
|
|
11659
11659
|
return binding_default().transform(source, _options);
|
|
11660
11660
|
}
|
|
11661
|
-
let exports_rspackVersion = "1.6.0-canary-
|
|
11661
|
+
let exports_rspackVersion = "1.6.0-canary-e28e40e9-20251022173516", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
|
11662
11662
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
11663
11663
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
11664
11664
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
package/dist/util/fs.d.ts
CHANGED
|
@@ -68,6 +68,28 @@ interface IDirent {
|
|
|
68
68
|
isSocket: () => boolean;
|
|
69
69
|
name: string | Buffer;
|
|
70
70
|
}
|
|
71
|
+
export interface StreamOptions {
|
|
72
|
+
flags?: string;
|
|
73
|
+
encoding?: NodeJS.BufferEncoding;
|
|
74
|
+
fd?: any;
|
|
75
|
+
mode?: number;
|
|
76
|
+
autoClose?: boolean;
|
|
77
|
+
emitClose?: boolean;
|
|
78
|
+
start?: number;
|
|
79
|
+
signal?: null | AbortSignal;
|
|
80
|
+
}
|
|
81
|
+
export interface FSImplementation {
|
|
82
|
+
open?: (...args: any[]) => any;
|
|
83
|
+
close?: (...args: any[]) => any;
|
|
84
|
+
}
|
|
85
|
+
export type CreateReadStreamFSImplementation = FSImplementation & {
|
|
86
|
+
read: (...args: any[]) => any;
|
|
87
|
+
};
|
|
88
|
+
export type ReadStreamOptions = StreamOptions & {
|
|
89
|
+
fs?: null | CreateReadStreamFSImplementation;
|
|
90
|
+
end?: number;
|
|
91
|
+
};
|
|
92
|
+
export type CreateReadStream = (path: PathLike, options?: NodeJS.BufferEncoding | ReadStreamOptions) => NodeJS.ReadableStream;
|
|
71
93
|
export interface OutputFileSystem {
|
|
72
94
|
writeFile: (arg0: string | number, arg1: string | Buffer, arg2: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
73
95
|
mkdir: (arg0: string, arg1: (arg0?: null | NodeJS.ErrnoException) => void) => void;
|
|
@@ -81,6 +103,7 @@ export interface OutputFileSystem {
|
|
|
81
103
|
join?: (arg0: string, arg1: string) => string;
|
|
82
104
|
relative?: (arg0: string, arg1: string) => string;
|
|
83
105
|
dirname?: (arg0: string) => string;
|
|
106
|
+
createReadStream?: CreateReadStream;
|
|
84
107
|
}
|
|
85
108
|
export type JsonPrimitive = string | number | boolean | null;
|
|
86
109
|
export type JsonArray = JsonValue[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/core",
|
|
3
|
-
"version": "1.6.0-canary-
|
|
3
|
+
"version": "1.6.0-canary-e28e40e9-20251022173516",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@ast-grep/napi": "^0.39.6",
|
|
41
41
|
"@rsbuild/plugin-node-polyfill": "^1.4.2",
|
|
42
|
-
"@rslib/core": "0.
|
|
42
|
+
"@rslib/core": "0.16.0",
|
|
43
43
|
"@swc/types": "0.1.25",
|
|
44
44
|
"@types/node": "^20.19.23",
|
|
45
45
|
"@types/watchpack": "^2.4.4",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@module-federation/runtime-tools": "0.21.1",
|
|
59
59
|
"@rspack/lite-tapable": "1.0.1",
|
|
60
|
-
"@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-
|
|
60
|
+
"@rspack/binding": "npm:@rspack-canary/binding@1.6.0-canary-e28e40e9-20251022173516"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@swc/helpers": ">=0.5.1"
|