diff --git a/packages/workbox-cli/src/lib/questions/ask-questions.ts b/packages/workbox-cli/src/lib/questions/ask-questions.ts index 1ba491d75..3b2c5011f 100644 --- a/packages/workbox-cli/src/lib/questions/ask-questions.ts +++ b/packages/workbox-cli/src/lib/questions/ask-questions.ts @@ -23,16 +23,21 @@ interface ConfigWithConfigLocation { export async function askQuestions( options = {}, ): Promise { + const isInjectManifest = 'injectManifest' in options; + const globDirectory = await askRootOfWebApp(); const globPatterns = await askExtensionsToCache(globDirectory); - const swSrc = 'injectManifest' in options ? await askSWSrc() : undefined; + const swSrc = isInjectManifest ? await askSWSrc() : undefined; const swDest = await askSWDest(globDirectory); const configLocation = await askConfigLocation(); - const ignoreURLParametersMatching = await askQueryParametersInStartUrl(); + // See https://github.com/GoogleChrome/workbox/issues/2985 + const ignoreURLParametersMatching = isInjectManifest + ? undefined + : await askQueryParametersInStartUrl(); + const config: {[key: string]: any} = { globDirectory, globPatterns, - ignoreURLParametersMatching, swDest, }; @@ -40,6 +45,10 @@ export async function askQuestions( config.swSrc = swSrc; } + if (ignoreURLParametersMatching) { + config.ignoreURLParametersMatching = ignoreURLParametersMatching; + } + return { config, configLocation, diff --git a/test/workbox-cli/node/lib/questions/ask-questions.js b/test/workbox-cli/node/lib/questions/ask-questions.js index fb39380d5..d2c3ab97c 100644 --- a/test/workbox-cli/node/lib/questions/ask-questions.js +++ b/test/workbox-cli/node/lib/questions/ask-questions.js @@ -93,10 +93,9 @@ describe(`[workbox-cli] lib/questions/ask-questions.js`, function () { globPatterns: 1, swSrc: 2, swDest: 3, - ignoreURLParametersMatching: 5, }, configLocation: 4, }); - expect(stub.callCount).to.eql(6); + expect(stub.callCount).to.eql(5); }); });