A simple webpack plugin to support dotenv.
Include the package locally in your repository.
npm install dotenv-webpack --save
The plugin can be installed with little-to-no configuration needed.
// webpack.config.js
const Dotenv = require('dotenv-webpack');
module.exports = {
...
plugins: [
new Dotenv({
path: './.env', // can be ommitted as this is the default
safe: false, // make true to use dotenv-safe and require varialbes
sample: './.env.example', // if safe=true, use this to define the safe env
systemvars: false // if true, also loads system env variables
})
]
...
};
MIT