Skip to content

Commit c4a21b7

Browse files
authored
Skip ignoreURLParametersMatching (#2992)
1 parent cdfc4cb commit c4a21b7

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/workbox-cli/src/lib/questions/ask-questions.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,32 @@ interface ConfigWithConfigLocation {
2323
export async function askQuestions(
2424
options = {},
2525
): Promise<ConfigWithConfigLocation> {
26+
const isInjectManifest = 'injectManifest' in options;
27+
2628
const globDirectory = await askRootOfWebApp();
2729
const globPatterns = await askExtensionsToCache(globDirectory);
28-
const swSrc = 'injectManifest' in options ? await askSWSrc() : undefined;
30+
const swSrc = isInjectManifest ? await askSWSrc() : undefined;
2931
const swDest = await askSWDest(globDirectory);
3032
const configLocation = await askConfigLocation();
31-
const ignoreURLParametersMatching = await askQueryParametersInStartUrl();
33+
// See https://github.com/GoogleChrome/workbox/issues/2985
34+
const ignoreURLParametersMatching = isInjectManifest
35+
? undefined
36+
: await askQueryParametersInStartUrl();
37+
3238
const config: {[key: string]: any} = {
3339
globDirectory,
3440
globPatterns,
35-
ignoreURLParametersMatching,
3641
swDest,
3742
};
3843

3944
if (swSrc) {
4045
config.swSrc = swSrc;
4146
}
4247

48+
if (ignoreURLParametersMatching) {
49+
config.ignoreURLParametersMatching = ignoreURLParametersMatching;
50+
}
51+
4352
return {
4453
config,
4554
configLocation,

test/workbox-cli/node/lib/questions/ask-questions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ describe(`[workbox-cli] lib/questions/ask-questions.js`, function () {
9393
globPatterns: 1,
9494
swSrc: 2,
9595
swDest: 3,
96-
ignoreURLParametersMatching: 5,
9796
},
9897
configLocation: 4,
9998
});
100-
expect(stub.callCount).to.eql(6);
99+
expect(stub.callCount).to.eql(5);
101100
});
102101
});

0 commit comments

Comments
 (0)