mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
6f162b94e1
Introduce env to next.config.js for build-time configuration
9 lines
300 B
JavaScript
9 lines
300 B
JavaScript
import getConfig from 'next/config'
|
|
const {serverRuntimeConfig, publicRuntimeConfig} = getConfig()
|
|
|
|
export default () => <div>
|
|
<p id='server-only'>{serverRuntimeConfig.mySecret}</p>
|
|
<p id='server-and-client'>{publicRuntimeConfig.staticFolder}</p>
|
|
<p id='env'>{process.env.customVar}</p>
|
|
</div>
|