Skip to content

Commit

Permalink
trying things out
Browse files Browse the repository at this point in the history
  • Loading branch information
beerose committed Dec 2, 2021
1 parent b6a4ed1 commit 2e72e8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/compressed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Count size
uses: preactjs/compressed-size-action@v2
with:
Expand Down
11 changes: 3 additions & 8 deletions nextjs/packages/next-env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ export function loadEnvConfig(

const isTest = process.env.NODE_ENV === 'test'
const mode = isTest ? 'test' : dev ? 'development' : 'production'
const appEnv = process.env.APP_ENV
let dotenvFiles = [
`.env.${mode}.local`,
appEnv && `.env.${appEnv}.local`,
appEnv && `.env.${appEnv}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
Expand All @@ -89,14 +92,6 @@ export function loadEnvConfig(
'.env',
].filter(Boolean) as string[]

if (process.env.APP_ENV) {
dotenvFiles = [
`.env.${process.env.APP_ENV}.local`,
`.env.${process.env.APP_ENV}`,
...dotenvFiles,
]
}

for (const envFile of dotenvFiles) {
// only load .env if the user provided has an env config file
const dotEnvPath = path.join(dir, envFile)
Expand Down

0 comments on commit 2e72e8b

Please sign in to comment.