babel-plugin-inline-dotenv icon indicating copy to clipboard operation
babel-plugin-inline-dotenv copied to clipboard

support multi env files

Open meishier opened this issue 6 years ago • 3 comments

there're two env files. .env

AAA=aaa BBB=bbb

.env.prod

AAA=prod

and I want get

AAA=prod BBB=bbb

I tried to config in babe.config.js, but no luck

const plugins = [ [ 'inline-dotenv', { path: './env/.env.prod', }, '' ], [ 'inline-dotenv', { path: './env/.env', }, 'inline-dotenv-base' ],

seems that inline-dotenv plugin runs only ONCE

did I miss something else? thanks

meishier avatar Jul 12 '19 06:07 meishier

the direction of this package is not towards dotenv flow. if that's what you need, you're better off using other packages like (shameless plug) react-native-dotenv

goatandsheep avatar May 18 '21 01:05 goatandsheep

The problem with react-native-dotenv is it doesn't work with process.env. It solves a different problem.

wholebuzz avatar Jun 25 '21 00:06 wholebuzz

react-native-dotenv is based on this library

goatandsheep avatar Jun 25 '21 03:06 goatandsheep