Skip to content

Commit 712a5da

Browse files
committed
use .map rather than .forEach in makeBaseBundleConfig
1 parent 29e747a commit 712a5da

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

rollup/bundleHelpers.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ export function makeBaseBundleConfig(options) {
8888
* @returns An array of versions of that config
8989
*/
9090
export function makeBundleConfigVariants(baseConfig) {
91-
const configVariants = [];
92-
9391
const { plugins: baseConfigPlugins } = baseConfig;
9492
const includeDebuggingPlugin = makeIsDebugBuildPlugin(true);
9593
const stripDebuggingPlugin = makeIsDebugBuildPlugin(false);
@@ -131,14 +129,11 @@ export function makeBundleConfigVariants(baseConfig) {
131129
},
132130
];
133131

134-
variantSpecificConfigs.forEach(variant => {
135-
const mergedConfig = deepMerge(baseConfig, variant, {
132+
return variantSpecificConfigs.map(variant =>
133+
deepMerge(baseConfig, variant, {
136134
// this makes it so that instead of concatenating the `plugin` properties of the two objects, the first value is
137135
// just overwritten by the second value
138136
arrayMerge: (first, second) => second,
139-
});
140-
configVariants.push(mergedConfig);
141-
});
142-
143-
return configVariants;
137+
}),
138+
);
144139
}

0 commit comments

Comments
 (0)