@rspack/core 1.0.0-alpha.4 → 1.0.0-beta.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/compiled/zod/index.d.ts +138 -52
- package/compiled/zod/index.js +300 -103
- package/compiled/zod/package.json +1 -1
- package/compiled/zod-validation-error/index.js +6 -6
- package/dist/Compilation.d.ts +21 -3
- package/dist/Compilation.js +64 -49
- package/dist/Compiler.js +28 -28
- package/dist/ErrorHelpers.js +2 -4
- package/dist/FileSystem.js +6 -6
- package/dist/Module.js +2 -6
- package/dist/ModuleTypeConstants.d.ts +45 -69
- package/dist/ModuleTypeConstants.js +24 -77
- package/dist/NormalModule.js +6 -6
- package/dist/Stats.js +4 -6
- package/dist/Template.d.ts +31 -147
- package/dist/Template.js +40 -236
- package/dist/Watching.js +2 -2
- package/dist/builtin-loader/lightningcss/index.d.ts +89 -0
- package/dist/builtin-loader/lightningcss/index.js +175 -0
- package/dist/builtin-plugin/BannerPlugin.d.ts +24 -48
- package/dist/builtin-plugin/DefinePlugin.js +9 -13
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +24 -0
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +8 -8
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +10 -3
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +4 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +7 -17
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +15 -23
- package/dist/builtin-plugin/base.js +1 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +17 -66
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +2 -0
- package/dist/builtin-plugin/css-extract/hmr/{normalize-url.js → normalizeUrl.js} +15 -24
- package/dist/builtin-plugin/css-extract/loader.js +6 -6
- package/dist/builtin-plugin/css-extract/utils.js +3 -3
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +3 -3
- package/dist/builtin-plugin/lazy-compilation/backend.js +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapter.js +31 -30
- package/dist/config/adapterRuleUse.d.ts +5 -5
- package/dist/config/adapterRuleUse.js +23 -1
- package/dist/config/browserslistTargetHandler.d.ts +17 -15
- package/dist/config/browserslistTargetHandler.js +27 -33
- package/dist/config/defaults.js +27 -28
- package/dist/config/normalization.d.ts +2 -0
- package/dist/config/normalization.js +5 -5
- package/dist/config/target.d.ts +48 -109
- package/dist/config/target.js +50 -86
- package/dist/config/zod.d.ts +2398 -2212
- package/dist/config/zod.js +29 -19
- package/dist/container/ContainerPlugin.d.ts +7 -7
- package/dist/container/options.js +1 -1
- package/dist/exports.d.ts +4 -4
- package/dist/exports.js +2 -2
- package/dist/lib/CacheFacade.js +1 -0
- package/dist/lib/EntryOptionPlugin.js +2 -2
- package/dist/lib/ModuleFilenameHelpers.js +1 -3
- package/dist/lib/WebpackError.js +1 -1
- package/dist/lib/cache/mergeEtags.js +5 -11
- package/dist/lib/formatLocation.js +3 -5
- package/dist/loader-runner/LoaderLoadingError.d.ts +11 -1
- package/dist/loader-runner/LoaderLoadingError.js +3 -5
- package/dist/loader-runner/index.js +23 -25
- package/dist/loader-runner/loadLoader.d.ts +11 -2
- package/dist/loader-runner/loadLoader.js +18 -20
- package/dist/logging/createConsoleLogger.js +2 -6
- package/dist/logging/truncateArgs.js +5 -9
- package/dist/node/NodeWatchFileSystem.js +5 -5
- package/dist/node/nodeConsole.js +2 -4
- package/dist/rspack.js +6 -6
- package/dist/rspackOptionsApply.js +3 -3
- package/dist/stats/DefaultStatsFactoryPlugin.js +65 -20
- package/dist/stats/DefaultStatsPresetPlugin.js +4 -4
- package/dist/stats/DefaultStatsPrinterPlugin.js +12 -17
- package/dist/stats/StatsFactory.js +13 -17
- package/dist/stats/StatsPrinter.js +7 -9
- package/dist/stats/statsFactoryUtils.d.ts +9 -10
- package/dist/util/AssetInfo.js +11 -7
- package/dist/util/SplitChunkSize.js +1 -1
- package/dist/util/bindingVersionCheck.js +6 -6
- package/dist/util/cleverMerge.d.ts +33 -57
- package/dist/util/cleverMerge.js +89 -145
- package/dist/util/comparators.js +3 -5
- package/dist/util/createHash.d.ts +4 -3
- package/dist/util/createHash.js +31 -45
- package/dist/util/fs.js +16 -20
- package/dist/util/hash/BatchedHash.d.ts +24 -9
- package/dist/util/hash/BatchedHash.js +16 -13
- package/dist/util/hash/index.d.ts +9 -9
- package/dist/util/hash/index.js +14 -11
- package/dist/util/hash/md4.d.ts +29 -2
- package/dist/util/hash/md4.js +7 -3
- package/dist/util/hash/wasm-hash.d.ts +52 -5
- package/dist/util/hash/wasm-hash.js +19 -22
- package/dist/util/hash/xxhash64.d.ts +29 -2
- package/dist/util/hash/xxhash64.js +7 -3
- package/dist/util/identifier.js +13 -19
- package/dist/util/index.js +1 -1
- package/dist/util/memoize.js +7 -9
- package/package.json +9 -8
- package/dist/builtin-plugin/css-extract/hmr/normalize-url.d.ts +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* The following code is modified based on
|
|
3
4
|
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/util/hash/xxhash64.js
|
|
@@ -7,11 +8,14 @@
|
|
|
7
8
|
* Copyright (c) JS Foundation and other contributors
|
|
8
9
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const wasm_hash_1 = __importDefault(require("./wasm-hash"));
|
|
12
16
|
//#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
|
|
13
17
|
const xxhash64 = new WebAssembly.Module(Buffer.from(
|
|
14
18
|
// 1170 bytes
|
|
15
19
|
"AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
|
|
16
20
|
//#endregion
|
|
17
|
-
|
|
21
|
+
exports.default = wasm_hash_1.default.bind(null, xxhash64, [], 32, 16);
|
package/dist/util/identifier.js
CHANGED
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.getUndoPath = exports.parseResourceWithoutFragment = exports.parseResource = exports.absolutify = exports.contextify = exports.makePathsAbsolute = exports.makePathsRelative = void 0;
|
|
10
|
-
const
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/;
|
|
12
12
|
const SEGMENTS_SPLIT_REGEXP = /([|!])/;
|
|
13
13
|
const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
|
|
@@ -37,7 +37,7 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
|
|
|
37
37
|
let resource = querySplitPos === -1
|
|
38
38
|
? maybeAbsolutePath
|
|
39
39
|
: maybeAbsolutePath.slice(0, querySplitPos);
|
|
40
|
-
resource = relativePathToRequest(
|
|
40
|
+
resource = relativePathToRequest(node_path_1.default.posix.relative(context, resource));
|
|
41
41
|
return querySplitPos === -1
|
|
42
42
|
? resource
|
|
43
43
|
: resource + maybeAbsolutePath.slice(querySplitPos);
|
|
@@ -47,7 +47,7 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
|
|
|
47
47
|
let resource = querySplitPos === -1
|
|
48
48
|
? maybeAbsolutePath
|
|
49
49
|
: maybeAbsolutePath.slice(0, querySplitPos);
|
|
50
|
-
resource =
|
|
50
|
+
resource = node_path_1.default.win32.relative(context, resource);
|
|
51
51
|
if (!WINDOWS_ABS_PATH_REGEXP.test(resource)) {
|
|
52
52
|
resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/"));
|
|
53
53
|
}
|
|
@@ -65,7 +65,7 @@ const absoluteToRequest = (context, maybeAbsolutePath) => {
|
|
|
65
65
|
*/
|
|
66
66
|
const requestToAbsolute = (context, relativePath) => {
|
|
67
67
|
if (relativePath.startsWith("./") || relativePath.startsWith("../"))
|
|
68
|
-
return
|
|
68
|
+
return node_path_1.default.join(context, relativePath);
|
|
69
69
|
return relativePath;
|
|
70
70
|
};
|
|
71
71
|
const makeCacheable = (realFn) => {
|
|
@@ -130,11 +130,9 @@ const makeCacheableWithContext = (fn) => {
|
|
|
130
130
|
if (cachedResult !== undefined) {
|
|
131
131
|
return cachedResult;
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
133
|
+
const result = fn(context, identifier);
|
|
134
|
+
innerSubCache.set(identifier, result);
|
|
135
|
+
return result;
|
|
138
136
|
};
|
|
139
137
|
/**
|
|
140
138
|
* @param {Object=} associatedObjectForCache an object to which the cache will be attached
|
|
@@ -170,11 +168,9 @@ const makeCacheableWithContext = (fn) => {
|
|
|
170
168
|
if (cachedResult !== undefined) {
|
|
171
169
|
return cachedResult;
|
|
172
170
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return result;
|
|
177
|
-
}
|
|
171
|
+
const result = fn(context, identifier);
|
|
172
|
+
innerSubCache.set(identifier, result);
|
|
173
|
+
return result;
|
|
178
174
|
};
|
|
179
175
|
return boundFn;
|
|
180
176
|
};
|
|
@@ -208,11 +204,9 @@ const makeCacheableWithContext = (fn) => {
|
|
|
208
204
|
if (cachedResult !== undefined) {
|
|
209
205
|
return cachedResult;
|
|
210
206
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return result;
|
|
215
|
-
}
|
|
207
|
+
const result = fn(context, identifier);
|
|
208
|
+
innerSubCache?.set(identifier, result);
|
|
209
|
+
return result;
|
|
216
210
|
};
|
|
217
211
|
return boundFn;
|
|
218
212
|
};
|
package/dist/util/index.js
CHANGED
package/dist/util/memoize.js
CHANGED
|
@@ -10,15 +10,13 @@ const memoize = (fn) => {
|
|
|
10
10
|
// @ts-expect-error
|
|
11
11
|
return result;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
13
|
+
result = fn();
|
|
14
|
+
cache = true;
|
|
15
|
+
// Allow to clean up memory for fn
|
|
16
|
+
// and all dependent resources
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
fn = undefined;
|
|
19
|
+
return result;
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
22
|
exports.memoize = memoize;
|
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-beta.0",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -48,18 +48,19 @@
|
|
|
48
48
|
"json-parse-even-better-errors": "^3.0.0",
|
|
49
49
|
"neo-async": "2.6.2",
|
|
50
50
|
"prebundle": "^1.1.0",
|
|
51
|
+
"typescript": "5.0.2",
|
|
51
52
|
"tsc-alias": "^1.8.8",
|
|
52
53
|
"watchpack": "^2.4.0",
|
|
53
54
|
"webpack-sources": "3.2.3",
|
|
54
|
-
"webpack-dev-server": "
|
|
55
|
-
"zod": "^3.
|
|
55
|
+
"webpack-dev-server": "^5.0.4",
|
|
56
|
+
"zod": "^3.23.8",
|
|
56
57
|
"zod-validation-error": "1.3.1"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"@module-federation/runtime-tools": "0.2.3",
|
|
60
61
|
"caniuse-lite": "^1.0.30001616",
|
|
61
|
-
"@rspack/
|
|
62
|
-
"@rspack/
|
|
62
|
+
"@rspack/binding": "1.0.0-beta.0",
|
|
63
|
+
"@rspack/lite-tapable": "1.0.0-beta.0"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"@swc/helpers": ">=0.5.1"
|
|
@@ -70,9 +71,9 @@
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
|
-
"build": "
|
|
74
|
-
"build:force": "
|
|
75
|
-
"dev": "
|
|
74
|
+
"build": "tsc -b ./tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run prepare-container-runtime",
|
|
75
|
+
"build:force": "tsc -b ./tsconfig.build.json --force && tsc-alias -p tsconfig.build.json && npm run prepare-container-runtime",
|
|
76
|
+
"dev": "tsc -w",
|
|
76
77
|
"prepare-container-runtime": "node ./scripts/prepare-container-runtime.js",
|
|
77
78
|
"doc-coverage": "node scripts/check-documentation-coverage.mjs",
|
|
78
79
|
"api-extractor": "api-extractor run --verbose",
|