Skip to content

Commit

Permalink
Limit the webpack stats to what we need (#2132)
Browse files Browse the repository at this point in the history
* Limit the webpack stats to what we need

* Change an assertion
  • Loading branch information
jeffposnick authored Jul 19, 2019
1 parent c626898 commit b0825d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ function assetToChunkNameMapping(stats) {
*/
function filterAssets(compilation, config) {
const filteredAssets = new Set();
const stats = compilation.getStats().toJson();
// See https://webpack.js.org/configuration/stats/#stats
// We only need assets and chunkGroups here.
const stats = compilation.getStats().toJson({
assets: true,
chunkGroups: true,
});

const assetNameToChunkNames = assetToChunkNameMapping(stats);

Expand Down
2 changes: 1 addition & 1 deletion test/workbox-precaching/sw/test-PrecacheController.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ describe(`PrecacheController`, function() {
}

const cleanupDetailsTwo = await precacheControllerTwo.activate();
expect(cleanupDetailsTwo.deletedURLs).to.deep.equal([
expect(cleanupDetailsTwo.deletedURLs).to.have.members([
`${location.origin}/index.1234.html`,
`${location.origin}/scripts/stress.js?test=search&foo=bar&__WB_REVISION__=1234`,
]);
Expand Down

0 comments on commit b0825d7

Please sign in to comment.