diff --git a/packages/server/src/ChunkExtractor.js b/packages/server/src/ChunkExtractor.js
index e3bddfbd..49a1af6d 100644
--- a/packages/server/src/ChunkExtractor.js
+++ b/packages/server/src/ChunkExtractor.js
@@ -297,7 +297,7 @@ class ChunkExtractor {
].join('')
}
- getRequiredChunksScriptElement(extraProps) {
+ getRequiredChunksScriptElements(extraProps) {
const id = getRequiredChunkKey(this.namespace)
const props = {
type: 'application/json',
@@ -381,14 +381,14 @@ class ChunkExtractor {
}
getScriptElements(extraProps = {}) {
- const requiredScriptElement = this.getRequiredChunksScriptElement(
+ const requiredScriptElements = this.getRequiredChunksScriptElements(
extraProps,
)
const mainAssets = this.getMainAssets('script')
const assetsScriptElements = mainAssets.map(asset =>
assetToScriptElement(asset, extraProps),
)
- return [requiredScriptElement, ...assetsScriptElements]
+ return [...requiredScriptElements, ...assetsScriptElements]
}
getCssString() {
diff --git a/packages/server/src/ChunkExtractor.test.js b/packages/server/src/ChunkExtractor.test.js
index ba775855..110401b2 100644
--- a/packages/server/src/ChunkExtractor.test.js
+++ b/packages/server/src/ChunkExtractor.test.js
@@ -133,26 +133,24 @@ describe('ChunkExtrator', () => {
})
expect(extractor.getScriptElements()).toMatchInlineSnapshot(`
Array [
- Array [
- ,
- ,
+ ,
- ],
+ }
+ id="testapp__LOADABLE_REQUIRED_CHUNKS___ext"
+ type="application/json"
+ />,