Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

cortopy/webpack-electron-packager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Electron apps without the bloat

Webpack plugin to build Electron apps. It's particularly useful to package Electron Apps which only contain required modules and assets.

Features

Usage

Documentation: Using loaders

npm install webpack-electron-packager -D

And then, in your webpack config:

const ElectronPackager = require("webpack-electron-packager");
module.exports = {
    plugins: [
        new ElectronPackager({
          dir: "/path/to/app",
          arch: "x64",
          platform: "linux",
        })
    ]
}

Options

Plugin accepts all options in electron-packager. They can be passed in either CamelCase (e.g.: buildVersion) or with hyphens (e.g.: build-version).

Plugin also adds the following:

externals

Sometimes, you may need to have libraries as externals. If that's the case, pass the name of the module or an array of modules as externals.

const ElectronPackager = require("webpack-electron-packager");
module.exports = {
    plugins: [
        new ElectronPackager({
          ...
          externals: "my-npm-package"
        })
    ]
}

Tests

npm test