Electron Forge Plugin Webpack
A plugin for Electron Forge that brings first class electron-compile
support to your build pipeline.
Usage
npm i @electron-forge/plugin-compile --save-dev
const { CompilePlugin } = require('@electron-forge/plugin-webpack')
module.exports = {
plugins: [new CompilePlugin()]
}
Project Setup
In order for this plugin to work correctly you need to have a few things
in place
electron-prebuilt-compile
installed instead of electron
as a devDependency
electron-compile
as a dependency
- A correctly configured
.compilerc
in the root of your project, an example is included below
Once your project is setup and the plugin added to your configuration, everything should
Just Work(tm).
Example .compilerc
{
"env": {
"development": {
"application/javascript": {
"presets": [
["env", { "targets": { "electron": "1.8" } }],
"react"
],
"plugins": ["transform-async-to-generator"],
"sourceMaps": "inline"
}
},
"production": {
"application/javascript": {
"presets": [
["env", { "targets": { "electron": "1.8" } }],
"react"
],
"plugins": ["transform-async-to-generator"],
"sourceMaps": "none"
}
}
}
}