All Projects → sindresorhus → Electron Reloader

sindresorhus / Electron Reloader

Licence: mit
Simple auto-reloading for Electron apps during development

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Electron Reloader

Conduct
🖖 Generate a Code of Conduct for your project
Stars: ✭ 360 (-22.25%)
Mutual labels:  npm-package
Hotreload
Xamarin.Forms XAML hot reload, live reload, live xaml
Stars: ✭ 407 (-12.1%)
Mutual labels:  livereload
Trex
Package Manager for deno 🦕
Stars: ✭ 433 (-6.48%)
Mutual labels:  npm-package
Terminal Link
Create clickable links in the terminal
Stars: ✭ 361 (-22.03%)
Mutual labels:  npm-package
Cpx
A cli tool to watch and copy file globs.
Stars: ✭ 394 (-14.9%)
Mutual labels:  npm-package
Negative Array
Negative array index support `array[-1]` using ES2015 Proxy
Stars: ✭ 420 (-9.29%)
Mutual labels:  npm-package
Typescript Webpack Starter
⚡ create-ts-lib: A Starter Kit and a CLI to create your TypeScript / ES6 module bundled by Webpack without thinking about build or unit tests configurations. 🏠
Stars: ✭ 358 (-22.68%)
Mutual labels:  npm-package
Cloudinary npm
Cloudinary NPM for node.js integration
Stars: ✭ 450 (-2.81%)
Mutual labels:  npm-package
Core
The internationalization (i18n) library for Angular
Stars: ✭ 4,027 (+769.76%)
Mutual labels:  npm-package
Npm Run All
A CLI tool to run multiple npm-scripts in parallel or sequential.
Stars: ✭ 4,496 (+871.06%)
Mutual labels:  npm-package
React Pro Sidebar
Customizable and responsive react sidebar library with dropdown menus and unlimited number of nested submenus
Stars: ✭ 359 (-22.46%)
Mutual labels:  npm-package
Npm Module Boilerplate
Boilerplate for npm modules with ES6 features and all the best practices
Stars: ✭ 374 (-19.22%)
Mutual labels:  npm-package
Ky Universal
Use Ky in both Node.js and browsers
Stars: ✭ 421 (-9.07%)
Mutual labels:  npm-package
Eslint Formatter Pretty
Pretty ESLint formatter
Stars: ✭ 361 (-22.03%)
Mutual labels:  npm-package
Sindresorhus Cli
The Sindre Sorhus CLI
Stars: ✭ 436 (-5.83%)
Mutual labels:  npm-package
Squirrelly
Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript ⛺
Stars: ✭ 359 (-22.46%)
Mutual labels:  npm-package
Realize
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
Stars: ✭ 4,162 (+798.92%)
Mutual labels:  livereload
Electron Better Ipc
Simplified IPC communication for Electron apps
Stars: ✭ 463 (+0%)
Mutual labels:  npm-package
Figures
Unicode symbols with Windows CMD fallbacks
Stars: ✭ 438 (-5.4%)
Mutual labels:  npm-package
Node Thermal Printer
This npm package was made to control epson and star thermal printers
Stars: ✭ 424 (-8.42%)
Mutual labels:  npm-package

electron-reloader

Simple auto-reloading for Electron apps during development

It just works. When files used in the main process are changed, the app is restarted, and when files used in the browser window are changed, the page is reloaded.

Note that it will not work correctly if you transpile the main process JS files of your app, but it doesn't make sense to do that anyway.

Install

$ npm install --save-dev electron-reloader

Requires Electron 5 or later.

Usage

The following must be included in the app entry file, usually named index.js:

try {
	require('electron-reloader')(module);
} catch {}

You have to pass the module object so we can read the module graph and figure out which files belong to the main process.

The try/catch is needed so it doesn't throw Cannot find module 'electron-reloader' in production.

API

reloader(module, options?)

module

Type: object

The global module object.

options

Type: object

ignore

Type: Array<string | RegExp>

Ignore patterns passed to chokidar.

By default, files/directories starting with a ., .map files, and node_modules directories are ignored. This option is additive to those.

watchRenderer

Type: boolean
Default: true

Watch files used in the renderer process and reload the window when they change.

Setting this to false can be useful if you use a different reload strategy in the rendererer process, like HMR.

debug

Type: boolean
Default: false

Prints watched paths and when files change.

Can be useful to make sure you set it up correctly.

Tip

Using it with Webpack watch mode

Just add the source directory to the ignore option. The dist directory is already watched, so when a source file changes, webpack will build it and output it to the dist directory, which this module will detect.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].