🛠
Electron Adapter
This is a library to build platform (win, linux, mac) executables for a bundled static web application. It is also possible to debug the application with HMR.
Table of Contents
Installation
npm install --save electron-adapter
Important NOTE
The README.md
file is under construction
Usage
The best way to use the following commands, is by creating shortcuts in the package.json
file.
{
"scripts": {
"init": "electron-adapter init",
"dev": "electron-adapter dev",
"build": "electron-adapter build"
}
}
Init
To init the project folder with the necessary files, run the command:
npm run init
or
electron-adapter init
This will create the following files/directories, if they do not already exist:
Directories
- entrypoint
- src
Files
- .electron-builder.yml
- tsconfig.json
- entrypoint/index.ts
- src/index.js
- src/index.html
The entrypoint
& src
path and other specifications,
can be changed with a configuration file in the root directory of the project.
Therefore, create a .electron-adapter.yml
file in the root folder with the following content:
module.exports = {
port: 9000,
// framework: 'nuxt' | 'next',
// rootPath: '',
// buildDirectory: 'dist',
entrypointDirectory: 'entrypoint',
// entrypointWebpack: undefined,
rendererDirectory: 'src',
// rendererWebpack: undefined,
}
Dev
To run the application in development mode, with Hot Module Replacement (HMR).
npm run dev
or
electron-adapter dev
Build
To build the application for an operating system, run the following command.
npm run build
or
electron-adapter build
License
Made with
Published under MIT License.