1 | ![Module](https://img.shields.io/badge/%40platform-electron-%23EA4E7E.svg)
|
2 | [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
3 | [![NPM](https://img.shields.io/npm/v/@platform/electron.svg?colorB=blue&style=flat)](https://www.npmjs.com/package/@platform/electron)
|
4 | # electron
|
5 | Common utilities for working with [electron](https://electronjs.org).
|
6 |
|
7 | ## Manual Test
|
8 | To run an electron test shell, see the [electron-test](../electron-test/README.md) module:
|
9 |
|
10 | ```bash
|
11 | cd electron-test
|
12 | yarn ui start
|
13 | ```
|
14 |
|
15 |
|
16 |
|
17 | <p> <p>
|
18 |
|
19 | ## Polyfill
|
20 | The `babel-polyfill` is included to ensure [Parcel](https://parceljs.org) bundles correctly without causing certain errors when building a production distribution, for example this [issue](https://github.com/parcel-bundler/parcel/issues/871#issuecomment-367899522):
|
21 |
|
22 | ```
|
23 | regeneratorRuntime is not defined 😩
|
24 | ```
|
25 |
|
26 | <p> <p>
|
27 |
|
28 |
|
29 | ## Building for Electron
|
30 | If you encounter `dist` build issues you may need to re-compile native modules.
|
31 | See [Using Native Node Modules](https://electronjs.org/docs/tutorial/using-native-node-modules) for background.
|
32 |
|
33 | Run the `rebuild` script against your module. For example, in your `package.json`:
|
34 |
|
35 | ```json
|
36 | {
|
37 | "scripts": {
|
38 | "rebuild": "platform.electron rebuild"
|
39 | }
|
40 | }
|
41 | ```
|
42 | This will need to be done every time after `npm install` or `yarn install` has been run.
|
43 |
|
44 |
|
45 | <p> <p>
|
46 | <p> <p>
|
47 |
|