webpack-config-env
v0.1.0
Published
Inject environment variables into your [webpack] build.
Downloads
7
Readme
#webpack-config-env
Inject environment variables into your webpack build.
Usage
Install:
npm install --save webpack-config-env
Add to your webpack.config.babel.js
:
import env from `webpack-config-env`;
env({
NODE_ENV: {required: false},
DEPLOY_ENV: {required: process.env.NODE_ENV === 'production'},
API_URL: {
required: true,
value: process.env.NODE_ENV !== 'production'
? 'https://my-app-api.herokuapp.com/api'
: undefined,
},
})({
/* existing webpack configuration */
})