File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * This is a browser shim for the `config` module that gets its configuration
3+ * values from `next/config`. It supports the `get()` and `has()` methods but
4+ * not extras like `config.util`. Since this file will not be transpiled, it
5+ * must use syntax supported by all browsers.
6+ */
17var getConfig = require ( "next/config" ) . default ;
28
3- var { serverRuntimeConfig, publicRuntimeConfig } = getConfig ( ) ;
4-
59/**
610 * Underlying `get` mechanism.
711 *
@@ -53,10 +57,13 @@ function has(obj, property) {
5357 return getImpl ( obj , property ) !== undefined ;
5458}
5559
56- const {
57- nodeConfigServerKey = "serverRuntimeConfig" ,
58- nodeConfigPublicKey = "publicRuntimeConfig"
59- } = publicRuntimeConfig ;
60+ var runtimeConfig = getConfig ( ) ;
61+ var serverRuntimeConfig = runtimeConfig . serverRuntimeConfig ;
62+ var publicRuntimeConfig = runtimeConfig . publicRuntimeConfig ;
63+ var nodeConfigServerKey =
64+ publicRuntimeConfig . nodeConfigServerKey || "serverRuntimeConfig" ;
65+ var nodeConfigPublicKey =
66+ publicRuntimeConfig . nodeConfigPublicKey || "publicRuntimeConfig" ;
6067
6168var config = { } ;
6269config [ nodeConfigServerKey ] = serverRuntimeConfig ;
You can’t perform that action at this time.
0 commit comments