1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Set default for serverRuntimeConfig (#3938)

This commit is contained in:
Tim Neutkens 2018-03-05 14:00:29 +01:00 committed by GitHub
parent dbb1b732a0
commit 0107051eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,9 @@ export default class Server {
availableChunks: dev ? {} : getAvailableChunks(this.dir, this.dist) availableChunks: dev ? {} : getAvailableChunks(this.dir, this.dist)
} }
const {serverRuntimeConfig, publicRuntimeConfig, assetPrefix} = this.nextConfig // Only serverRuntimeConfig needs the default
// publicRuntimeConfig gets it's default in client/index.js
const {serverRuntimeConfig = {}, publicRuntimeConfig, assetPrefix} = this.nextConfig
// Only the `publicRuntimeConfig` key is exposed to the client side // Only the `publicRuntimeConfig` key is exposed to the client side
// It'll be rendered as part of __NEXT_DATA__ on the client side // It'll be rendered as part of __NEXT_DATA__ on the client side