
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
babel-plugin-inline-env-vars
Advanced tools
Plugin which replaces all instances of process.env.***
with the environment variable value.
Aims to have the same functionality as inline-environment-variables-webpack-plugin
npm install --save-dev babel-plugin-inline-env-vars
If you would like to inline all environment variables then you can just instantiate the plugin without passing any config, as in the following example.
{
"plugins": [
"inline-env-vars"
]
}
You can optionally pass a config in "vars" property of plugin options to select which environment variables you would like to inline.
A config can be either a string an object or an array.
A string config is defined like
{
"plugins": [
["inline-env-vars", {
"vars": "NODE_ENV"
}]
]
}
The above config will inline process.env.NODE_ENV
with the value of process.env.NODE_ENV
at build time
an object config is defined like
{
"plugins": [
["inline-env-vars", {
"vars": { "NODE_ENV": "production" }
}]
]
}
The above config will inline process.env.NODE_ENV
with the value specified in the config. So in the above example it would change it to 'production'
;
and array config is just a list of string and object configs. It would be defined like
{
"plugins": [
["inline-env-vars", {
"vars": [
"SOME_VAR",
"ANOTHER_ONE",
{
"NODE_ENV": "production",
"ONE_MORE": true
}
]
}]
]
}
Pass in an object with warnings
set to false
.
{
"plugins": [
["inline-env-vars", {
"vars": { "NODE_ENV": "production" },
"warnings": false
}]
]
}
This plugin is based on:
FAQs
babel plugin to inline all environment variables
The npm package babel-plugin-inline-env-vars receives a total of 2 weekly downloads. As such, babel-plugin-inline-env-vars popularity was classified as not popular.
We found that babel-plugin-inline-env-vars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.