@@ -190,8 +190,14 @@ export function makeBaseBundleConfig(options) {
190190 return deepMerge ( sharedBundleConfig , isAddOn ? addOnBundleConfig : standAloneBundleConfig ) ;
191191}
192192
193- export function makeMinificationVariants ( baseConfig ) {
194- const newConfigs = [ ] ;
193+ /**
194+ * Takes the CDN rollup config for a given package and produces configs for both minified and unminified bundles.
195+ *
196+ * @param baseConfig The rollup config shared by the entire package
197+ * @returns An array of versions of that config
198+ */
199+ export function makeConfigVariants ( baseConfig ) {
200+ const configVariants = [ ] ;
195201
196202 const { plugins } = baseConfig ;
197203
@@ -201,7 +207,8 @@ export function makeMinificationVariants(baseConfig) {
201207 `Last plugin in given options should be \`rollup-plugin-license\`. Found ${ getLastElement ( plugins ) . name } ` ,
202208 ) ;
203209
204- const bundleVariants = [
210+ // The additional options to use for each variant we're going to create #namingishard
211+ const variantSpecificOptionsVariants = [
205212 {
206213 output : {
207214 file : `${ baseConfig . output . file } .js` ,
@@ -216,14 +223,14 @@ export function makeMinificationVariants(baseConfig) {
216223 } ,
217224 ] ;
218225
219- bundleVariants . forEach ( variant => {
226+ variantSpecificOptionsVariants . forEach ( variant => {
220227 const mergedConfig = deepMerge ( baseConfig , variant , {
221228 // this makes it so that instead of concatenating the `plugin` properties of the two objects, the first value is
222229 // just overwritten by the second value
223230 arrayMerge : ( first , second ) => second ,
224231 } ) ;
225- newConfigs . push ( mergedConfig ) ;
232+ configVariants . push ( mergedConfig ) ;
226233 } ) ;
227234
228- return newConfigs ;
235+ return configVariants ;
229236}
0 commit comments