@@ -40,6 +40,22 @@ export default class Queue {
4040 }
4141 }
4242
43+ private processGenerateVariants ( snapshot : Snapshot ) : void {
44+ if ( snapshot . options ) {
45+ if ( snapshot . options . web ) {
46+ this . generateWebVariants ( snapshot , snapshot . options . web ) ;
47+ }
48+ if ( snapshot . options . mobile ) {
49+ this . generateMobileVariants ( snapshot , snapshot . options . mobile ) ;
50+ }
51+ }
52+
53+ if ( ! snapshot . options || ( ! snapshot . options . web && ! snapshot . options . mobile ) ) {
54+ this . generateVariants ( snapshot , this . ctx . config ) ;
55+ }
56+ }
57+
58+
4359 private generateVariants ( snapshot : Snapshot , config : any ) : void {
4460 // Process web configurations if they exist
4561
@@ -275,17 +291,12 @@ export default class Queue {
275291 this . snapshotNames . push ( snapshot . name ) ;
276292 }
277293
278- if ( snapshot && snapshot . options && snapshot . options . web ) {
279- this . generateWebVariants ( snapshot , snapshot . options . web ) ;
294+ if ( snapshot ) {
295+ this . processGenerateVariants ( snapshot ) ;
280296 }
281297
282- if ( snapshot && snapshot . options && snapshot . options . mobile ) {
283- this . generateMobileVariants ( snapshot , snapshot . options . mobile )
284- }
285-
286- if ( ( snapshot && ! snapshot . options ) || ( snapshot && snapshot . options && ! snapshot . options . web && ! snapshot . options . mobile ) ) {
287- this . generateVariants ( snapshot , this . ctx . config ) ;
288- }
298+ console . log ( "***********" )
299+ console . log ( JSON . stringify ( snapshot . options ) )
289300
290301 if ( ! drop ) {
291302 let { processedSnapshot, warnings } = await processSnapshot ( snapshot , this . ctx ) ;
0 commit comments