{"library":"node-env-webpack-plugin","title":"Node Env Webpack Plugin","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install node-env-webpack-plugin"],"cli":null},"imports":["import NodeEnvPlugin from 'node-env-webpack-plugin'","import NodeEnvPlugin from 'node-env-webpack-plugin'; NodeEnvPlugin.isProduction","import NodeEnvPlugin from 'node-env-webpack-plugin'; NodeEnvPlugin.devtool"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nimport NodeEnvPlugin from 'node-env-webpack-plugin';\n\nexport default {\n  entry: './src/index.js',\n  output: {\n    filename: 'bundle.js'\n  },\n  devtool: NodeEnvPlugin.devtool,\n  plugins: [\n    new NodeEnvPlugin()\n  ]\n};","lang":"javascript","description":"Minimal webpack config using NodeEnvPlugin to auto-set NODE_ENV and configure devtool based on environment.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}