Skip to content
This repository was archived by the owner on Aug 2, 2026. It is now read-only.

v6.0.0

Choose a tag to compare

@Arkellys Arkellys released this 15 Sep 12:52
· 36 commits to main since this release

✨ Features

Add support for ES6 imports on all processes. 🎉

Main and preload files are now compiled even in development, which means CJS require can now be replaced ES6 import on the files of these processes. In order for this to work, main and preload paths have to point to the built files.

package.json

{
  "main": "build/static/js/electron.main.js",
}

Main file

Since the preload file(s) will be compiled both in development and production, you can use a single path for both environment. Built files use the names declared in the configuration file: electron.preload.[name].js

new BrowserWindow({
  webPreferences: {
    // With a preload entry key named `app`
    preload: path.join(__dirname, "electron.preload.app.js"),
  }
});

💥 Breaking changes

Remove support for ESM.

On the previous version, ESM was only supported thanks to a workaround (because I couldn't figure out how to configure webpack and SWC correctly) allowing the ESM equivalent of __dirname to be compiled as a dynamic path . Now that import can be used without ESM, this workaround was removed and so CJS __dirname must be available.

Rebuiltron configuration file must now have the extension .js instead of .cjs.

rebuiltron.config.cjs  --->  rebuiltron.config.js

📦 Dependencies