Socket
Socket
Sign inDemoInstall

electron-reloader

Package Overview
Dependencies
30
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 1.0.0

16

index.js

@@ -9,5 +9,5 @@ 'use strict';

const chalk = require('chalk');
const findUp = require('find-up');
function getMainProcessPaths(topModuleObject) {
const cwd = path.dirname(topModuleObject.filename);
function getMainProcessPaths(topModuleObject, cwd) {
const paths = new Set([topModuleObject.filename]);

@@ -31,5 +31,5 @@

module.exports = (moduleObj, options) => {
module.exports = (moduleObject, options) => {
// This module should be a dev dependency, but guard
// this in case the user included it as a dependency
// this in case the user included it as a dependency.
if (!isDev) {

@@ -39,3 +39,3 @@ return;

if (!moduleObj) {
if (!moduleObject) {
throw new Error('You have to pass the `module` object');

@@ -49,4 +49,6 @@ }

const cwd = path.dirname(moduleObj.filename);
const mainProcessPaths = getMainProcessPaths(moduleObj);
const mainProcessDirectory = path.dirname(moduleObject.filename);
const packageDirectory = findUp.sync('package.json', {cwd: mainProcessDirectory});
const cwd = packageDirectory ? path.dirname(packageDirectory) : mainProcessDirectory;
const mainProcessPaths = getMainProcessPaths(moduleObject, cwd);
const watchPaths = options.watchRenderer ? cwd : [...mainProcessPaths];

@@ -53,0 +55,0 @@

{
"name": "electron-reloader",
"version": "0.3.0",
"version": "1.0.0",
"description": "Simple auto-reloading for Electron apps during development",
"license": "MIT",
"repository": "sindresorhus/electron-reloader",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {

@@ -14,3 +15,3 @@ "name": "Sindre Sorhus",

"test": "xo",
"start": "electron test"
"start": "electron test/main"
},

@@ -40,10 +41,11 @@ "files": [

"dependencies": {
"chalk": "^2.4.2",
"chokidar": "^3.0.0",
"chalk": "^3.0.0",
"chokidar": "^3.3.1",
"date-time": "^3.1.0",
"electron-is-dev": "^1.1.0"
"electron-is-dev": "^1.1.0",
"find-up": "^4.1.0"
},
"devDependencies": {
"electron": "^5.0.1",
"xo": "^0.24.0"
"electron": "^8.0.0",
"xo": "^0.25.3"
},

@@ -50,0 +52,0 @@ "xo": {

@@ -9,3 +9,2 @@ # electron-reloader [![Build Status](https://travis-ci.org/sindresorhus/electron-reloader.svg?branch=master)](https://travis-ci.org/sindresorhus/electron-reloader)

## Install

@@ -19,3 +18,2 @@

## Usage

@@ -35,6 +33,5 @@

## API
### reloader(module, [options])
### reloader(module, options?)

@@ -53,3 +50,3 @@ #### module

Type: `boolean`<br>
Type: `boolean`\
Default: `false`

@@ -67,3 +64,3 @@

Type: `boolean`<br>
Type: `boolean`\
Default: `true`

@@ -75,10 +72,8 @@

## Tip
### Using it with webpack watch mode
### 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

@@ -92,6 +87,1 @@

- [electron-serve](https://github.com/sindresorhus/electron-serve) - Static file serving for Electron apps
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc