Skip to content

Commit

Permalink
bug #609 Fix old integrity hashes being added to the entrypoints.json…
Browse files Browse the repository at this point in the history
… with --watch (Lyrkan)

This PR was merged into the master branch.

Discussion
----------

Fix old integrity hashes being added to the entrypoints.json with --watch

This PR fixes a really small issue that I noticed while working on #608.

When using `--watch` and `enableIntegrityHashes()` together it works fine for the first compilation, but on the next ones the old hashes also get added to the `entrypoints.json` file.

**First compilation:**

```json
{
  "entrypoints": {
    "main": {
      "js": [
        "/build/main.js"
      ]
    }
  },
  "integrity": {
    "/build/main.js": "<OLDHASH>"
  }
}
```

**Second compilation:**

```json
{
  "entrypoints": {
    "integrity": {
      "/build/main.js": ["<OLDHASH>"]
    },
    "main": {
      "js": [
        "/build/main.js"
      ]
    }
  },
  "integrity": {
    "/build/main.js": "<NEWHASH>"
  }
}
```

Commits
-------

eecebb7 Fix old integrity hashes being added to the entrypoints.json with --watch
  • Loading branch information
weaverryan committed Aug 9, 2019
2 parents a6e3d84 + eecebb7 commit 54cb1b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/plugins/entry-files-manifest.js
Expand Up @@ -28,8 +28,10 @@ function processOutput(webpackConfig) {
// the original assets (so, assets.entrypoints) + the new
// assets (which will have their original structure). We
// delete the entrypoints key, and then process the new assets
// like normal below
// like normal below. The same reasoning applies to the
// integrity key.
delete assets.entrypoints;
delete assets.integrity;

// This will iterate over all the entry points and convert the
// one file entries into an array of one entry since that was how the entry point file was before this change.
Expand Down

0 comments on commit 54cb1b8

Please sign in to comment.