webpack-env-prefix-plugin
v1.1.1
Published
Webpack plugin to populate process.env with prefixed env vars e.g. REACT_APP
Downloads
1,235
Maintainers
Readme
webpack-env-prefix-plugin
Packages the REACT_APP_*
env handling from create-react-app
as a standalone webpack plugin.
Usage
npm install --save-dev webpack-env-prefix-plugin
// webpack.config.js
const EnvPrefixPlugin = require('webpack-env-prefix-plugin')
module.exports = {
plugins: [
new EnvPrefixPlugin()
]
}
const config = {
NODE_ENV: process.env.NODE_ENV,
MY_CONFIG: process.env.REACT_APP_MY_CONFIG,
}