npx create-react-vite-capacitor-electronThis comes with cross-platform key-value storage via the cross-platform-util and cross-platform-util-electron-preload packages. I will modify the cross-platform-util to use Capacitor's storage in the capacitor case later. For now Capacitor and web uses local-storage and Electron uses a json file created in userData directory.
If you do not want to use this storage:
- Remove the
cross-platform-utilandcross-platform-util-electron-preloaddependencies. - Remove the following from preload.ts:
import { fileAPI } from 'cross-platform-util-electron-preload';
contextBridge.exposeInMainWorld('fileAPI', fileAPI);- Remove references to the storage stuff in Page1.tsx (if you are gonna use that page as a template for your work. If not, just delete the whole page.)
After that remobe "How to start your own project using this template" from the README.md file.
npm installnpm run build-webnpm run build-androidnpm run build-iosnpm run build-electron-linux(build scripts for more platforms coming soon. I just got to get on those machines and test them first.)
npm run dev-electronnpm run dev