Skip to content

A Webpack plugin to generate the Electron package.json with the values in the project package.json

Notifications You must be signed in to change notification settings

michaeljota/electron-package-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electron Package Plugin

A Webpack plugin to generate the Electron package.json with the values in the project package.json

Installation

npm install --save electron-package-plugin

Usage

Giving the package.json in your project, ex:

{
  "name": "example-package",
  "version": "0.0.0-example",
  "description": "This is an example package"
}

You can just set the plugin in the Electron main webpack.config.js

// webpack.config.js
const ElectronPackagePlugin = require('electron-package-plugin');

module.exports = {
  // ...
  plugins: [
    // ...
    new ElectronPackagePlugin(),
  ]
  // ...
};

This will generate a package.json file in the target folder as the follow:

{
  "name": "example-package",
  "version": "0.0.0-example",
  "description": "This is an example package",
  "main": "main.js"
}

The plugin will read and use the follow properties:

{
  name,
  version,
  description,
  keywords,
  author,
  homepage,
  license,
  repository,
  bugs,
  engines,
}

Options

  • main: (default: main.js) You can set the name of the main file of you Electron aplication.

Acknowledgment

This plugin it's just a specific use-case using the awesome generate-json-webpack-plugin. Really thanks to the author @elliottsj.

Todo

  • Tests
  • Set an option to define the structure to be used

Changelog

  • v0.1.1 - Fixed Node v4 compatibility (2016-10-30)
  • v0.1.0 - Initial release (2016-10-26)

About

A Webpack plugin to generate the Electron package.json with the values in the project package.json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published