d8155b22ff
* Add initial support for new env config file * Fix serverless processEnv call when no env is provided * Add missing await for test method * Update env config to .env.json and add dotenv loading * ncc dotenv package * Update type * Update with new discussed behavior removing .env.json * Update hot-reloader createEntrypoints * Make sure .env is loaded before next.config.js * Add tests for all separate .env files * Remove comments * Add override tests * Add test for overriding env vars based on local environment * Add support for .env.test * Apply suggestions from code review Co-Authored-By: Joe Haddad <joe.haddad@zeit.co> * Use chalk for env loaded message * Remove constant as it’s not needed * Update test * Update errsh, taskr, and CNA template ignores * Make sure to only consider undefined missing * Remove old .env ignore * Update to not populate process.env with loaded env * Add experimental flag and add loading of global env values Co-authored-by: Tim Neutkens <timneutkens@me.com> Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
30 lines
880 B
JavaScript
30 lines
880 B
JavaScript
export const config = {
|
|
env: [
|
|
'PROCESS_ENV_KEY',
|
|
'ENV_FILE_KEY',
|
|
'LOCAL_ENV_FILE_KEY',
|
|
'ENV_FILE_LOCAL_OVERRIDE_TEST',
|
|
'PRODUCTION_ENV_FILE_KEY',
|
|
'LOCAL_PRODUCTION_ENV_FILE_KEY',
|
|
'DEVELOPMENT_ENV_FILE_KEY',
|
|
'LOCAL_DEVELOPMENT_ENV_FILE_KEY',
|
|
'ENV_FILE_DEVELOPMENT_OVERRIDE_TEST',
|
|
'ENV_FILE_DEVELOPMENT_LOCAL_OVERRIDEOVERRIDE_TEST',
|
|
'ENV_FILE_PRODUCTION_OVERRIDEOVERRIDE_TEST',
|
|
'ENV_FILE_PRODUCTION_LOCAL_OVERRIDEOVERRIDE_TEST',
|
|
'TEST_ENV_FILE_KEY',
|
|
'LOCAL_TEST_ENV_FILE_KEY',
|
|
'ENV_FILE_TEST_OVERRIDE_TEST',
|
|
'ENV_FILE_TEST_LOCAL_OVERRIDEOVERRIDE_TEST',
|
|
],
|
|
}
|
|
|
|
export async function getServerSideProps({ env }) {
|
|
return {
|
|
// Do not pass any sensitive values here as they will
|
|
// be made PUBLICLY available in `pageProps`
|
|
props: { env },
|
|
}
|
|
}
|
|
|
|
export default ({ env }) => <p>{JSON.stringify(env)}</p>
|