bengreenier / parcel-plugin-electron-process

Parcel development plugin that spawns and re-spawns an electron process. πŸ§¬πŸ“¦βš™

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parcel-plugin-electron-process

Parcel development plugin that spawns and re-spawns an electron process. πŸ§¬πŸ“¦βš™

I needed a plugin that would allow me to run electron automatically, when parcel built my code successfully (on buildEnd) to imitate the behavior that occurs when building for the browser. However, better electron support hasn't landed yet - so I created this.

Usage

In any Parcel project:

# -D installs as a devDependency
npm install -D parcel-plugin-electron-process

# Use it
parcel --target electron path/to/file.ext

# Use it (forcably, with a non-electron target)
npx cross-env PARCEL_PLUGIN_ELECTRON_PROC=1 parcel --target node path/to/file.ext

# Disable it (with an electron target)
npx cross-env PARCEL_PLUGIN_ELECTRON_PROC=0 parcel --target electron path/to/file.ext

Notes

  • After install, parcel will autodetect the plugin and begin using it.
  • PARCEL_PLUGIN_ELECTRON_PROC overrides the default detection case (1 or 0)
  • By default, the plugin is only active when target=electron and watch=true

About

Parcel development plugin that spawns and re-spawns an electron process. πŸ§¬πŸ“¦βš™

License:MIT License


Languages

Language:JavaScript 100.0%