1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/test/integration/config/pages/next-config.js
Connor Davis 6f162b94e1 Add Error when using publicRuntimeConfig with target serverless and add buildVars (#6212)
Introduce env to next.config.js for build-time configuration
2019-02-08 14:38:18 +01:00

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>