Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

envkey-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envkey-webpack-plugin - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

16

index.js
var webpack = require('webpack'),
envkey = require('envkey/loader')
module.exports = EnvkeyWebpackPlugin;
module.exports = EnvkeyWebpackPlugin
function EnvkeyWebpackPlugin(opts) {
var env = envkey.load(opts),
defineParams = { NODE_ENV: JSON.stringify(process.env.NODE_ENV) }
defineParams = {}
for (k in env) defineParams[k] = JSON.stringify(env[k]);
if (!opts.permitted || !opts.permitted.length){
throw new Error("'permitted' key required to specifiy vars whitelisted for client.")
}
return new webpack.DefinePlugin({"process.env": defineParams});
if (opts.permitted.indexOf("NODE_ENV") > -1){
defineParams.NODE_ENV = JSON.stringify(process.env.NODE_ENV)
}
for (k in env) defineParams[k] = JSON.stringify(env[k])
return new webpack.DefinePlugin({"process.env": defineParams})
}
{
"name": "envkey-webpack-plugin",
"version": "0.1.0",
"version": "0.1.1",
"description": "Use envkey as a webpack plugin.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc