electron-webpack simplifies webpack configuration for Electron apps, providing a pre-configured setup for main and renderer processes with HMR, Babel, and CSS support. Current stable version is 2.8.2 (latest release March 2021). It is a mature project with periodic bug fixes; development appears to have slowed but it remains functional for webpack 4. Key differentiators: updates via a single module instead of boilerplate, automatic Babel config based on Electron version, and add-on system for TypeScript, Less, etc. Note: it does not support webpack 5, and the project is in maintenance mode.
npm install electron-webpackVerified import paths — ran on the pinned version, not inferred.
Shows minimal package.json scripts to run dev and build commands using electron-webpack CLI.
Keep webpack at version ^4.42.1 or consider migrating to electron-forge or other webpack 5 solutions.
Evaluate alternative tools like electron-forge with webpack plugin or custom webpack config.
Avoid custom Babel config; use electron-webpack's 'babel' option in package.json if needed.
Name CSS files with *.module.css extension to use CSS Modules.
Use Node.js 10 or later.
Run: npm install webpack@^4.42.1 --save-dev
Ensure you have src/main/index.js or configure entry in package.json under 'electronWebpack'.
Install and configure add-on like electron-webpack-vue or electron-webpack-ts.