Skip to content

Commit

Permalink
Skip ignoreURLParametersMatching (#2992)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick authored Dec 2, 2021
1 parent cdfc4cb commit c4a21b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 12 additions & 3 deletions packages/workbox-cli/src/lib/questions/ask-questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,32 @@ interface ConfigWithConfigLocation {
export async function askQuestions(
options = {},
): Promise<ConfigWithConfigLocation> {
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,
};

if (swSrc) {
config.swSrc = swSrc;
}

if (ignoreURLParametersMatching) {
config.ignoreURLParametersMatching = ignoreURLParametersMatching;
}

return {
config,
configLocation,
Expand Down
3 changes: 1 addition & 2 deletions test/workbox-cli/node/lib/questions/ask-questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit c4a21b7

Please sign in to comment.