Skip to content

Commit e078811

Browse files
committed
create default env file to production
1 parent 5931f9d commit e078811

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import path from 'path'
1212

1313
dotenv.config()
1414

15+
const fileEnv = process.env.NODE_ENV ? `.env.${process.env.NODE_ENV}` : '.env'
16+
1517
// get the env variables from the .env file relative to the current NODE_ENV
16-
const ENV_VARS = dotenv.parse(
17-
fs.readFileSync(path.resolve(__dirname, `.env.${process.env.NODE_ENV}`))
18-
)
18+
const ENV_VARS = dotenv.parse(fs.readFileSync(path.resolve(__dirname, fileEnv)))
1919

2020
const valuesEnvToReplace = () => {
2121
return Object.entries(ENV_VARS).reduce((acc, [key, val]) => {

0 commit comments

Comments
 (0)