This package has been deprecated

Author message:

Please do't use react-script and any related packages. Use Vite instead. Here is why: https://www.youtube.com/watch?v=LQQ3CR2JTX8 . For Electron-side use esbuild

craco-electron
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

CRACO Electron

A simple CRACO configuration for Electron apps.

react-scripts already included in dependencies. You don't need to install it.

TL;DR

  1. Install it: npm or yarn add craco-electron

  2. 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/

Package Sidebar

Install

npm i craco-electron

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

6.45 kB

Total Files

9

Last publish

Collaborators

  • zardoy