Skip to content

Commit 2d37099

Browse files
szimekKyleAMathews
authored andcommitted
Move inlined webpack manifest to the end of body element (#3519)
1 parent fdeaf2a commit 2d37099

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

packages/gatsby/cache-dir/static-entry.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,6 @@ module.exports = (locals, callback) => {
137137
bodyHtml,
138138
})
139139

140-
// Add the chunk-manifest as a head component.
141-
const chunkManifest = require(`!raw!../public/chunk-manifest.json`)
142-
143-
headComponents.unshift(
144-
<script
145-
id="webpack-manifest"
146-
key="webpack-manifest"
147-
dangerouslySetInnerHTML={{
148-
__html: `/*<![CDATA[*/window.webpackManifest=${chunkManifest}/*]]>*/`,
149-
}}
150-
/>
151-
)
152-
153140
let stats
154141
try {
155142
stats = require(`../public/stats.json`)
@@ -208,6 +195,19 @@ module.exports = (locals, callback) => {
208195
/>
209196
)
210197

198+
// Add the chunk-manifest at the end of body element.
199+
const chunkManifest = require(`!raw!../public/chunk-manifest.json`)
200+
201+
postBodyComponents.unshift(
202+
<script
203+
id="webpack-manifest"
204+
key="webpack-manifest"
205+
dangerouslySetInnerHTML={{
206+
__html: `/*<![CDATA[*/window.webpackManifest=${chunkManifest}/*]]>*/`,
207+
}}
208+
/>
209+
)
210+
211211
const html = `<!DOCTYPE html>${renderToStaticMarkup(
212212
<Html
213213
{...bodyProps}

0 commit comments

Comments
 (0)