@reactenv/webpack
v0.1.47
Published
The webpack plugin for reactenv, an experimental solution to inject env variables after a build.
Downloads
115
Readme
@reactenv/webpack
The package contains reactenv
plugin for Webpack.
See
reactenv
repo for more information.
Installation
# npm
npm i -D @reactenv/webpack
# yarn
yarn add -D @reactenv/webpack
# pnpm
pnpm add -D @reactenv/webpack
Usage
See example webpack for an example project.
webpack.config.js
import the webpack plugin @reactenv/webpack
.
⚠️ This plugin cannot be used with webpack.EnvironmentPlugin
. Remove it, and instead pass the same props into @reactenv/webpack
as a replacement. ⚠️
const ReactenvWebpackPlugin = require('@reactenv/webpack');
module.exports = {
plugins: [new ReactenvWebpackPlugin({ ...process.env, ...dotenv.parsed })],
};