{"id":19457,"library":"electron-webpack-js","title":"electron-webpack-js","description":"JavaScript add-on for electron-webpack, providing webpack configuration for JavaScript and JSX files in Electron projects. Version 2.4.1 is bundled with electron-webpack, so no separate installation is needed. Part of the electron-webpack ecosystem that simplifies webpack setup for Electron main and renderer processes. Supports custom webpack config functions, static source directory configuration, CSS Modules, and .sass extension. Differentiators: zero-config webpack for Electron with Babel transpilation and optimized production builds using terser-webpack-plugin.","status":"maintenance","version":"2.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/electron-userland/electron-webpack","tags":["javascript"],"install":[{"cmd":"npm install electron-webpack-js","lang":"bash","label":"npm"},{"cmd":"yarn add electron-webpack-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add electron-webpack-js","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is automatically used by electron-webpack; manual import is unnecessary.","wrong":"Attempting to install it separately via npm install electron-webpack-js","symbol":"electron-webpack-js","correct":"This package is bundled with electron-webpack and should not be imported directly."}],"quickstart":{"code":"// No quickstart code because this package is an add-on that operates automatically.\n// To use, simply install electron-webpack and follow its configuration.\n// Example package.json scripts:\n// {\n//   \"scripts\": {\n//     \"dev\": \"electron-webpack dev\",\n//     \"build\": \"electron-webpack build\"\n//   }\n// }\n// For JavaScript support, no extra steps are required.","lang":"javascript","description":"Demonstrates that electron-webpack-js is automatically included with electron-webpack, so users just need to install the main package."},"warnings":[{"fix":"Use Create React App for Electron or electron-vite.","message":"electron-webpack and its add-ons are no longer actively maintained. Consider migrating to a more modern setup like electron-forge or Vite.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"If you were customizing uglifyjs-webpack-plugin, update your config to use terser-webpack-plugin instead.","message":"Version 2.4.0 switched from uglifyjs-webpack-plugin to terser-webpack-plugin due to ES6+ incompatibility.","severity":"breaking","affected_versions":"=2.4.0"},{"fix":"Remove electron-webpack-js from your dependencies if you manually added it.","message":"The package is bundled with electron-webpack and should not be installed separately. Doing so may cause version conflicts.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Do not import electron-webpack-js; it is automatically used by electron-webpack.","cause":"Attempting to import or require the package directly.","error":"Module not found: Error: Can't resolve 'electron-webpack-js'"},{"fix":"Ensure custom config function returns a valid webpack configuration or merges with the existing one properly.","cause":"Custom webpack config function returns an invalid object or tries to modify built-in config incorrectly.","error":"Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}