Simplifies NODE_ENV handling in webpack builds. Current stable version 2.0.0 (2024), requires Node.js >=18 and is pure ESM. Sets process.env.NODE_ENV automatically: defaults to 'development' at import time if undefined, or 'production' when webpack runs with -p. Provides convenience boolean getters (isProduction, isDevelopment, isTest) to avoid typos, and a devtool helper that selects source-map in production and cheap-module-source-map in development. Replaces manual NODE_ENV checks and webpack.EnvironmentPlugin setup with a single plugin.
npm install node-env-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal webpack config using NodeEnvPlugin to auto-set NODE_ENV and configure devtool based on environment.
Use import instead of require, and ensure Node.js >=18.
Upgrade to webpack 5.
Set NODE_ENV before importing the plugin or use explicit webpack mode.
If you need to force a specific NODE_ENV, set it explicitly in the environment.
Switch to import syntax (import NodeEnvPlugin from 'node-env-webpack-plugin') or use dynamic import() if needed.
Run 'npm install node-env-webpack-plugin' and ensure Node.js >=18.
No dependency data recorded yet.