Skip to content

Commit 652080a

Browse files
rebased with latest changes
1 parent 8cb1087 commit 652080a

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

src/lib/ctx.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export default (options: Record<string, string>): Context => {
7575
scrollTime: config.scrollTime || constants.DEFAULT_SCROLL_TIME,
7676
allowedHostnames: config.allowedHostnames || [],
7777
basicAuthorization: basicAuthObj,
78-
smartIgnore: config.smartIgnore ?? false
79-
deferUploads: config.deferUploads ?? false,
78+
smartIgnore: config.smartIgnore ?? false,
79+
deferUploads: config.deferUploads ?? false
8080
},
8181
uploadFilePath: '',
8282
webStaticConfig: [],

src/lib/processSnapshot.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)