electron-webpack-js

raw JSON →
2.4.1 verified Sat Apr 25 auth: no javascript maintenance

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.

error Module not found: Error: Can't resolve 'electron-webpack-js'
cause Attempting to import or require the package directly.
fix
Do not import electron-webpack-js; it is automatically used by electron-webpack.
error Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
cause Custom webpack config function returns an invalid object or tries to modify built-in config incorrectly.
fix
Ensure custom config function returns a valid webpack configuration or merges with the existing one properly.
deprecated electron-webpack and its add-ons are no longer actively maintained. Consider migrating to a more modern setup like electron-forge or Vite.
fix Use Create React App for Electron or electron-vite.
breaking Version 2.4.0 switched from uglifyjs-webpack-plugin to terser-webpack-plugin due to ES6+ incompatibility.
fix If you were customizing uglifyjs-webpack-plugin, update your config to use terser-webpack-plugin instead.
gotcha The package is bundled with electron-webpack and should not be installed separately. Doing so may cause version conflicts.
fix Remove electron-webpack-js from your dependencies if you manually added it.
npm install electron-webpack-js
yarn add electron-webpack-js
pnpm add electron-webpack-js

Demonstrates that electron-webpack-js is automatically included with electron-webpack, so users just need to install the main package.

// No quickstart code because this package is an add-on that operates automatically.
// To use, simply install electron-webpack and follow its configuration.
// Example package.json scripts:
// {
//   "scripts": {
//     "dev": "electron-webpack dev",
//     "build": "electron-webpack build"
//   }
// }
// For JavaScript support, no extra steps are required.