Registry / devops / inline-environment-variables-webpack-plugin

inline-environment-variables-webpack-plugin

JSON →
library1.2.1jsnpmunverified

A webpack plugin that replaces all instances of `process.env.***` with actual environment variable values at build time. Current stable version is 1.2.1, with infrequent releases. Key features: inline all environment variables by default, select specific variables using string/object/array config, or define static values. No runtime dependencies. Simpler alternative to webpack's DefinePlugin for basic env inlining, but limited to environment variables only and primarily intended for development/debugging use cases. Last updated in 2017.

npm install inline-environment-variables-webpack-plugin
INSTALL
IMPORT
SIG · INLINE-ENVIRONMENT
I
inline-environment-variables-webpack-plugin
devopsjavascriptv1.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InlineEnvironmentVariablesPlugin
const InlineEnvironmentVariablesPlugin = require('inline-environment-variables-webpack-plugin');
import InlineEnvironmentVariablesPlugin from 'inline-environment-variables-webpack-plugin';
Plugin is CJS only; ESM import not supported.
InlineEnviromentVariablesPlugin
const InlineEnvironmentVariablesPlugin = require('inline-environment-variables-webpack-plugin');
const InlineEnviromentVariablesPlugin = require('inline-environment-variables-webpack-plugin');
Typo in v1.2.0 and earlier: `InlineEnviromentVariablesPlugin` (missing 'n'). Correct name is `InlineEnvironmentVariablesPlugin`.
InlineEnvironmentVariablesPlugin (ESM)
const InlineEnvironmentVariablesPlugin = require('inline-environment-variables-webpack-plugin');
No ESM support; use CommonJS require.

Basic usage: instantiate plugin without config to replace all process.env.* calls with actual environment values at build time.

// webpack.config.js const InlineEnvironmentVariablesPlugin = require('inline-environment-variables-webpack-plugin'); module.exports = { plugins: [ new InlineEnvironmentVariablesPlugin() ] };
Debug
Known issues
breakingv1.2.0 and earlier used wrong export name `InlineEnviromentVariablesPlugin` (missing 'n'). v1.2.1 fixed this to `InlineEnvironmentVariablesPlugin`.
fix
Upgrade to v1.2.1 (npm install inline-environment-variables-webpack-plugin@latest) and rename imports to `InlineEnvironmentVariablesPlugin`.
affects: <=1.2.0
gotchaPlugin only replaces process.env.*** calls with string values; objects/functions will be serialized to string (e.g., 'true' for boolean true).
fix
Use webpack's DefinePlugin or EnvironmentPlugin for complex value replacement.
affects: all
deprecatedNo updates since 2017; consider using webpack's built-in EnvironmentPlugin or DotenvPlugin for modern projects.
fix
Use webpack.EnvironmentPlugin or @maika/env-development or dotenv-webpack instead.
affects: all
gotchaIf environment variable is undefined at build time, plugin replaces process.env.VAR with undefined string, possibly causing runtime errors.
fix
Ensure all referenced env vars are set; use config object to provide defaults.
affects: all
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'inline-environment-variables-webpack-plugin'
Plugin not installed or misspelled package name.
fix
Run `npm install --save-dev inline-environment-variables-webpack-plugin` and check import path.
TypeError: InlineEnvironmentVariablesPlugin is not a constructor
Using ESM import syntax (import from) instead of CommonJS require.
fix
Use `const InlineEnvironmentVariablesPlugin = require('inline-environment-variables-webpack-plugin');`
ReferenceError: process is not defined
Plugin not applied to bundle (e.g., missing in webpack config plugins array).
fix
Add `new InlineEnvironmentVariablesPlugin()` to the plugins array in webpack.config.js.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
inline-environment-variables-webpack-plugin — npm install inline-environment-variables-webpack-plugin · libregistry