2.5.1 • Published 1 year ago

envkey-webpack-plugin v2.5.1

Weekly downloads
922
License
MIT
Repository
github
Last release
1 year ago

envkey-webpack-plugin

A webpack plugin that wraps EnvKey's Node.js library so you can easily inject allow-listed configuration into your browser apps.

All vars will be available on process.env in the browser.

To make process.env.NODE_ENV available, just add it to the permitted allow-list (see below).

Install

npm i envkey-webpack-plugin --save-dev

Usage

var webpack = require("webpack"),
  EnvkeyWebpackPlugin = require("envkey-webpack-plugin");

module.exports = {
  //...

  plugins: [
    new EnvkeyWebpackPlugin({
      permitted: ["STRIPE_PUBLISHABLE_KEY", "PUSHER_APP_KEY", "NODE_ENV"], // required, specify allow-list of vars to pull from Envkey -- you can also include "NODE_ENV" to make that available

      dotEnvFile: ".env", // optional, specify alternate dotenv file path like ".env.staging" -- file should include valid ENVKEY variable

      define: { ANOTHER_VAR: "anotherVal" }, // optional, set additional vars on `process.env`
    }),
  ],

  //...
};
2.5.1

1 year ago

2.4.0

2 years ago

2.3.0

2 years ago

2.1.0

2 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

1.1.2

4 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago