CRACO Electron
A simple CRACO configuration for Electron apps.
react-scripts
already included in dependencies. You don't need to install it.
TL;DR
-
Install it: npm
or yarn add craco-electron
-
In your package.json
:
{
...
"scripts": {
- "start": "react-scripts start",
+ "start-renderer": "craco-electron start",
- "build": "react-scripts start",
+ "build-renderer": "craco-electron build"
}
...
}
Default Presets
PORT=3500
BROWSER=none
PUBLIC_URL=./
Note: you can still override this variables.
Runtime usage
This library brings not only cli. You can use these helpers in runtime:
getFileFromPublic
getMainPageUrl
For api see src/
.
TODO
- Script
start-main
for starting Electron process - Change default
src/
to src/react/