Skip to content

Commit

Permalink
prevent duplicate json entries in sync-requires.js
Browse files Browse the repository at this point in the history
This mitigates the dreaded "deoptimised" message from babel by
preventing the `sync-requires.js` file creating duplicates in the
`exports.json` hash.

```
[BABEL] Note: The code generator has deoptimised the styling of
"/Users/docwhat/Play/WebSites/docwhat/.cache/sync-requires.js" as it
exceeds the max of "500KB".
```
  • Loading branch information
docwhat committed Mar 23, 2018
1 parent 2c63272 commit f2c7402
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const writePages = async () => {

pageLayouts = _.uniq(pageLayouts)
components = _.uniqBy(components, c => c.componentChunkName)
json = _.uniqBy(json, x => x.jsonName)

// Create file with sync requires of layouts/components/json files.
let syncRequires = `// prefer default export if available
Expand Down

0 comments on commit f2c7402

Please # to comment.