1.0.0 • Published 6 years ago

generator-simple-react-electron v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Generator-Simple-React-Electron

A simple electron and react setup with parcel instead of webpack

Prerequisites

  1. Install Yeoman Globally npm install -g yo
  2. Install Electron Globally npm install -g electron

Setup

  1. Install Simple-React-Electron globally npm install -g simple-react-electron
  2. Create a new folder mkdir new-folder
  3. Go into the new folder cd new-folder
  4. Run Simple-React-Electron yo simple-react-electron
  5. Open new terminal and start parcelJS npm run dev
  6. Open another new terminal and start electronJS npm start
  7. Make your changes and reload the electronJS window

Build

  1. Go into main.js and replace win.loadURL('http://localhost:1234') with
win.loadURL(url.format({
    pathname: path.join(__dirname, 'build/distribute/index.html'),
    protocol: 'file:',
    slashes: true
}))
  1. Comment out win.webContents.openDevTools()
  2. Build with parcelJS npm run build
  3. Built files are in build/distribute

Contribute

  1. Clone Project git clone https://github.com/sidnand/Generator-Simple-React-Electron.git
  2. Go into the project Generator-Simple-React-Electron
  3. Run parcelJS npm run dev
  4. Run electronJS npm start