@rspack/core 0.7.0-beta.1-canary-2fe00c8-20240521070203 → 0.7.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/enhanced-resolve/CachedInputFileSystem.js +477 -0
- package/compiled/enhanced-resolve/index.d.ts +510 -0
- package/compiled/enhanced-resolve/index.js +5566 -0
- package/compiled/enhanced-resolve/license +20 -0
- package/compiled/enhanced-resolve/package.json +1 -0
- package/compiled/watchpack/index.js +6 -6
- package/dist/Compiler.js +8 -8
- package/dist/ResolverFactory.d.ts +2 -2
- package/dist/ResolverFactory.js +3 -3
- package/dist/builtin-plugin/css-extract/loader.js +0 -8
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
- package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +3 -3
- package/dist/config/adapter.js +5 -27
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/defaults.js +2 -21
- package/dist/config/normalization.d.ts +1 -2
- package/dist/config/normalization.js +2 -14
- package/dist/config/zod.d.ts +4 -121
- package/dist/config/zod.js +1 -19
- package/dist/lib/CacheFacade.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.js +1 -1
- package/dist/rspackOptionsApply.js +16 -18
- package/package.json +5 -5
package/dist/config/zod.js
CHANGED
|
@@ -587,20 +587,7 @@ const nodeOptions = zod_1.z.strictObject({
|
|
|
587
587
|
const node = zod_1.z.literal(false).or(nodeOptions);
|
|
588
588
|
//#endregion
|
|
589
589
|
//#region Snapshot
|
|
590
|
-
const snapshotOptions = zod_1.z.strictObject({
|
|
591
|
-
module: zod_1.z
|
|
592
|
-
.strictObject({
|
|
593
|
-
hash: zod_1.z.boolean().optional(),
|
|
594
|
-
timestamp: zod_1.z.boolean().optional()
|
|
595
|
-
})
|
|
596
|
-
.optional(),
|
|
597
|
-
resolve: zod_1.z
|
|
598
|
-
.strictObject({
|
|
599
|
-
hash: zod_1.z.boolean().optional(),
|
|
600
|
-
timestamp: zod_1.z.boolean().optional()
|
|
601
|
-
})
|
|
602
|
-
.optional()
|
|
603
|
-
});
|
|
590
|
+
const snapshotOptions = zod_1.z.strictObject({});
|
|
604
591
|
//#endregion
|
|
605
592
|
//#region Cache
|
|
606
593
|
const cacheOptions = zod_1.z.boolean();
|
|
@@ -754,7 +741,6 @@ const optimization = zod_1.z.strictObject({
|
|
|
754
741
|
//#endregion
|
|
755
742
|
//#region Experiments
|
|
756
743
|
const rspackFutureOptions = zod_1.z.strictObject({
|
|
757
|
-
newTreeshaking: zod_1.z.boolean().optional(),
|
|
758
744
|
bundlerInfo: zod_1.z
|
|
759
745
|
.strictObject({
|
|
760
746
|
version: zod_1.z.string().optional(),
|
|
@@ -826,9 +812,6 @@ const performance = zod_1.z
|
|
|
826
812
|
})
|
|
827
813
|
.or(zod_1.z.literal(false));
|
|
828
814
|
//#endregion
|
|
829
|
-
//#region Builtins (deprecated)
|
|
830
|
-
const builtins = zod_1.z.custom();
|
|
831
|
-
//#endregion
|
|
832
815
|
exports.rspackOptions = zod_1.z.strictObject({
|
|
833
816
|
name: name.optional(),
|
|
834
817
|
dependencies: dependencies.optional(),
|
|
@@ -855,7 +838,6 @@ exports.rspackOptions = zod_1.z.strictObject({
|
|
|
855
838
|
resolveLoader: resolve.optional(),
|
|
856
839
|
plugins: plugins.optional(),
|
|
857
840
|
devServer: devServer.optional(),
|
|
858
|
-
builtins: builtins.optional(),
|
|
859
841
|
module: moduleOptions.optional(),
|
|
860
842
|
profile: profile.optional(),
|
|
861
843
|
bail: bail.optional(),
|
package/dist/lib/CacheFacade.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
"use strict";
|
|
6
|
-
const { forEachBail } = require("enhanced-resolve");
|
|
6
|
+
const { forEachBail } = require("../../compiled/enhanced-resolve");
|
|
7
7
|
const asyncLib = require("../../compiled/neo-async");
|
|
8
8
|
const getLazyHashedEtag = require("./cache/getLazyHashedEtag.js");
|
|
9
9
|
const mergeEtags = require("./cache/mergeEtags.js");
|
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
14
14
|
*/
|
|
15
15
|
// @ts-expect-error
|
|
16
|
-
const CachedInputFileSystem_1 = __importDefault(require("enhanced-resolve/
|
|
16
|
+
const CachedInputFileSystem_1 = __importDefault(require("../../compiled/enhanced-resolve/CachedInputFileSystem"));
|
|
17
17
|
const graceful_fs_1 = __importDefault(require("../../compiled/graceful-fs"));
|
|
18
18
|
const createConsoleLogger_1 = __importDefault(require("../logging/createConsoleLogger"));
|
|
19
19
|
const nodeConsole_1 = __importDefault(require("./nodeConsole"));
|
|
@@ -26,7 +26,7 @@ const cleverMerge_1 = require("./util/cleverMerge");
|
|
|
26
26
|
class RspackOptionsApply {
|
|
27
27
|
constructor() { }
|
|
28
28
|
process(options, compiler) {
|
|
29
|
-
var _a, _b, _c
|
|
29
|
+
var _a, _b, _c;
|
|
30
30
|
(0, assert_1.default)(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`");
|
|
31
31
|
compiler.outputPath = options.output.path;
|
|
32
32
|
compiler.name = options.name;
|
|
@@ -147,29 +147,27 @@ class RspackOptionsApply {
|
|
|
147
147
|
if (options.optimization.mergeDuplicateChunks) {
|
|
148
148
|
new builtin_plugin_1.MergeDuplicateChunksPlugin().apply(compiler);
|
|
149
149
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
new builtin_plugin_1.MangleExportsPlugin(options.optimization.mangleExports !== "size").apply(compiler);
|
|
165
|
-
}
|
|
150
|
+
if (options.optimization.sideEffects) {
|
|
151
|
+
new builtin_plugin_1.SideEffectsFlagPlugin( /* options.optimization.sideEffects === true */).apply(compiler);
|
|
152
|
+
}
|
|
153
|
+
if (options.optimization.providedExports) {
|
|
154
|
+
new builtin_plugin_1.FlagDependencyExportsPlugin().apply(compiler);
|
|
155
|
+
}
|
|
156
|
+
if (options.optimization.usedExports) {
|
|
157
|
+
new builtin_plugin_1.FlagDependencyUsagePlugin(options.optimization.usedExports === "global").apply(compiler);
|
|
158
|
+
}
|
|
159
|
+
if (options.optimization.concatenateModules) {
|
|
160
|
+
new builtin_plugin_1.ModuleConcatenationPlugin().apply(compiler);
|
|
161
|
+
}
|
|
162
|
+
if (options.optimization.mangleExports) {
|
|
163
|
+
new builtin_plugin_1.MangleExportsPlugin(options.optimization.mangleExports !== "size").apply(compiler);
|
|
166
164
|
}
|
|
167
165
|
if (options.experiments.lazyCompilation) {
|
|
168
166
|
const lazyOptions = options.experiments.lazyCompilation;
|
|
169
167
|
new builtin_plugin_1.LazyCompilationPlugin(
|
|
170
168
|
// this is only for test
|
|
171
169
|
// @ts-expect-error cacheable is hide
|
|
172
|
-
(
|
|
170
|
+
(_a = lazyOptions.cacheable) !== null && _a !== void 0 ? _a : true, (_b = lazyOptions.entries) !== null && _b !== void 0 ? _b : true, (_c = lazyOptions.imports) !== null && _c !== void 0 ? _c : true, typeof lazyOptions.test === "function"
|
|
173
171
|
? function (jsModule) {
|
|
174
172
|
return lazyOptions.test.call(lazyOptions, new Module_1.Module(jsModule));
|
|
175
173
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "0.7.0-beta.
|
|
3
|
+
"version": "0.7.0-beta.2",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Fast Rust-based Web Bundler",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"copy-webpack-plugin": "5.1.2",
|
|
42
42
|
"cross-env": "^7.0.3",
|
|
43
43
|
"del": "^6.0.0",
|
|
44
|
+
"enhanced-resolve": "5.12.0",
|
|
44
45
|
"file-loader": "^6.2.0",
|
|
45
46
|
"glob": "^10.3.10",
|
|
46
47
|
"graceful-fs": "4.2.10",
|
|
@@ -71,16 +72,15 @@
|
|
|
71
72
|
"watchpack": "^2.4.0",
|
|
72
73
|
"zod": "^3.21.4",
|
|
73
74
|
"zod-validation-error": "1.3.1",
|
|
74
|
-
"@rspack/
|
|
75
|
-
"@rspack/
|
|
75
|
+
"@rspack/plugin-minify": "^0.7.0-beta.2",
|
|
76
|
+
"@rspack/core": "0.7.0-beta.2"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
79
|
"@module-federation/runtime-tools": "0.1.6",
|
|
79
80
|
"caniuse-lite": "^1.0.30001616",
|
|
80
|
-
"enhanced-resolve": "5.12.0",
|
|
81
81
|
"tapable": "2.2.1",
|
|
82
82
|
"webpack-sources": "3.2.3",
|
|
83
|
-
"@rspack/binding": "0.7.0-beta.
|
|
83
|
+
"@rspack/binding": "0.7.0-beta.2"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@swc/helpers": ">=0.5.1"
|