1.0.0 • Published 8 years ago
generator-simple-react-electron v1.0.0
Generator-Simple-React-Electron
A simple electron and react setup with parcel instead of webpack
Prerequisites
- Install Yeoman Globally
npm install -g yo - Install Electron Globally
npm install -g electron
Setup
- Install Simple-React-Electron globally
npm install -g simple-react-electron - Create a new folder
mkdir new-folder - Go into the new folder
cd new-folder - Run Simple-React-Electron
yo simple-react-electron - Open new terminal and start parcelJS
npm run dev - Open another new terminal and start electronJS
npm start - Make your changes and reload the electronJS window
Build
- Go into
main.jsand replacewin.loadURL('http://localhost:1234')with
win.loadURL(url.format({
pathname: path.join(__dirname, 'build/distribute/index.html'),
protocol: 'file:',
slashes: true
}))- Comment out
win.webContents.openDevTools() - Build with parcelJS
npm run build - Built files are in
build/distribute
Contribute
- Clone Project
git clone https://github.com/sidnand/Generator-Simple-React-Electron.git - Go into the project
Generator-Simple-React-Electron - Run parcelJS
npm run dev - Run electronJS
npm start