Skip to content

Commit

Permalink
Move inlined webpack manifest to the end of body element (#3519)
Browse files Browse the repository at this point in the history
  • Loading branch information
szimek authored and KyleAMathews committed Jan 15, 2018
1 parent fdeaf2a commit 2d37099
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/gatsby/cache-dir/static-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,6 @@ module.exports = (locals, callback) => {
bodyHtml,
})

// Add the chunk-manifest as a head component.
const chunkManifest = require(`!raw!../public/chunk-manifest.json`)

headComponents.unshift(
<script
id="webpack-manifest"
key="webpack-manifest"
dangerouslySetInnerHTML={{
__html: `/*<![CDATA[*/window.webpackManifest=${chunkManifest}/*]]>*/`,
}}
/>
)

let stats
try {
stats = require(`../public/stats.json`)
Expand Down Expand Up @@ -208,6 +195,19 @@ module.exports = (locals, callback) => {
/>
)

// Add the chunk-manifest at the end of body element.
const chunkManifest = require(`!raw!../public/chunk-manifest.json`)

postBodyComponents.unshift(
<script
id="webpack-manifest"
key="webpack-manifest"
dangerouslySetInnerHTML={{
__html: `/*<![CDATA[*/window.webpackManifest=${chunkManifest}/*]]>*/`,
}}
/>
)

const html = `<!DOCTYPE html>${renderToStaticMarkup(
<Html
{...bodyProps}
Expand Down

0 comments on commit 2d37099

Please sign in to comment.