-
Notifications
You must be signed in to change notification settings - Fork 2.1k
66 lines (66 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/dist/config/adapter.js b/dist/config/adapter.js
index 4eebbcf79cba29acbc0a36d565acc1c08eaf790b..1d87c9be33f69b8dda1436d8e3b970ce0b571112 100644
--- a/dist/config/adapter.js
+++ b/dist/config/adapter.js
@@ -15,6 +15,7 @@ const getRawOptions = (options, compiler) => {
const mode = options.mode;
const experiments = getRawExperiments(options.experiments);
return {
+ features: options.features,
mode,
target: getRawTarget(options.target),
context: options.context,
diff --git a/dist/config/defaults.js b/dist/config/defaults.js
index 1f9f61ff680b6db026c43eb95fe2d78c5f5d8195..56ce90247fd920717d42bc16864e6025fe6dca66 100644
--- a/dist/config/defaults.js
+++ b/dist/config/defaults.js
@@ -53,6 +53,11 @@ const applyRspackOptionsDefaults = (options) => {
applyExperimentsDefaults(options.experiments, {
cache: options.cache
});
+ if (options.features) {
+ applyFeaturesDefaults(options.features);
+ } else {
+ D(options, 'features', {});
+ }
applySnapshotDefaults(options.snapshot, { production });
applyModuleDefaults(options.module, {
// syncWebAssembly: options.experiments.syncWebAssembly,
@@ -103,6 +108,13 @@ const applyInfrastructureLoggingDefaults = (infrastructureLogging) => {
D(infrastructureLogging, "colors", tty);
D(infrastructureLogging, "appendOnly", !tty);
};
+const applyFeaturesDefaults = (features) => {
+ D(features, 'split_chunks_strategy', {});
+ if (typeof features.split_chunks_strategy === 'object') {
+ D(features.split_chunks_strategy, 'name', '');
+ D(features.split_chunks_strategy, 'topLevelFrameworks', []);
+ }
+};
const applyExperimentsDefaults = (experiments, { cache }) => {
D(experiments, "lazyCompilation", false);
D(experiments, "asyncWebAssembly", false);
diff --git a/dist/config/normalization.js b/dist/config/normalization.js
index 696eddf849f8a2f2c66237cb37db767f4dfe20ca..7e89b6091471de8287ce0785042676873141cfbe 100644
--- a/dist/config/normalization.js
+++ b/dist/config/normalization.js
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.getNormalizedRspackOptions = void 0;
const getNormalizedRspackOptions = (config) => {
return {
+ features: config.features,
ignoreWarnings: config.ignoreWarnings !== undefined
? config.ignoreWarnings.map(ignore => {
if (typeof ignore === "function") {
diff --git a/dist/config/zod.js b/dist/config/zod.js
index a81260f08e4e7de64ff3c1f8769a658db4c73883..df3184bad831922f64f3c41b64bce08fcdf5b3cd 100644
--- a/dist/config/zod.js
+++ b/dist/config/zod.js
@@ -775,5 +775,6 @@ exports.rspackOptions = zod_1.z.strictObject({
builtins: builtins.optional(),
module: moduleOptions.optional(),
profile: profile.optional(),
- bail: bail.optional()
+ bail: bail.optional(),
+ features: zod_1.z.custom().optional(),
});