2022-03-29 18:02:21 +08:00
|
|
|
# electron-vite-vue
|
2021-11-04 14:28:22 +08:00
|
|
|
|
2022-06-17 09:01:16 +08:00
|
|
|
🥳 Really simple `Electron` + `Vue` + `Vite` boilerplate.
|
|
|
|
|
2022-03-05 06:36:45 +08:00
|
|
|
[![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite)
|
2022-04-20 00:18:29 +08:00
|
|
|
[![Netlify Status](https://api.netlify.com/api/v1/badges/ae3863e3-1aec-4eb1-8f9f-1890af56929d/deploy-status)](https://app.netlify.com/sites/electron-vite/deploys)
|
2022-03-29 18:02:21 +08:00
|
|
|
![GitHub license](https://img.shields.io/github/license/caoxiemeihao/electron-vite-vue?style=flat)
|
|
|
|
![GitHub stars](https://img.shields.io/github/stars/caoxiemeihao/electron-vite-vue?color=fa6470&style=flat)
|
|
|
|
![GitHub forks](https://img.shields.io/github/forks/caoxiemeihao/electron-vite-vue?style=flat)
|
2021-11-12 08:35:08 +08:00
|
|
|
|
2022-06-17 09:01:16 +08:00
|
|
|
## Features
|
2022-04-26 09:19:55 +08:00
|
|
|
|
|
|
|
📦 Out of the box
|
2022-06-16 19:35:21 +08:00
|
|
|
🎯 Based on [vue-ts](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-vue-ts) template, less invasive
|
2022-06-17 09:01:16 +08:00
|
|
|
🌱 Extensible, really simple directory structure
|
2022-06-28 10:25:37 +08:00
|
|
|
💪 Support using Node.js API in Electron-Renderer
|
2022-06-16 19:35:21 +08:00
|
|
|
🔩 Support C/C++ native addons
|
2022-04-26 09:19:55 +08:00
|
|
|
🖥 It's easy to implement multiple windows
|
|
|
|
|
2022-03-03 20:04:55 +08:00
|
|
|
## Quick Start
|
2021-11-02 15:06:09 +08:00
|
|
|
|
2022-04-26 09:19:55 +08:00
|
|
|
```sh
|
|
|
|
npm create electron-vite
|
|
|
|
```
|
2022-03-23 20:03:44 +08:00
|
|
|
|
2022-04-26 09:19:55 +08:00
|
|
|
<!-- [![quick-start](https://asciinema.org/a/483731.svg)](https://asciinema.org/a/483731) -->
|
2022-03-05 06:36:45 +08:00
|
|
|
|
2022-06-16 19:35:21 +08:00
|
|
|
![electron-vite-vue.gif](https://github.com/electron-vite/electron-vite-vue/blob/main/public/electron-vite-vue.gif?raw=true)
|
2022-03-05 06:36:45 +08:00
|
|
|
|
2022-04-26 09:19:55 +08:00
|
|
|
## Debug
|
2022-03-05 06:36:45 +08:00
|
|
|
|
2022-06-16 19:35:21 +08:00
|
|
|
![electron-vite-react-debug.gif](https://github.com/electron-vite/electron-vite-react/blob/main/public/electron-vite-react-debug.gif?raw=true)
|
2022-03-05 06:36:45 +08:00
|
|
|
|
2021-11-11 18:29:18 +08:00
|
|
|
## Directory
|
|
|
|
|
2022-06-16 19:35:21 +08:00
|
|
|
```diff
|
|
|
|
+ ├─┬ electron
|
|
|
|
+ │ ├─┬ main
|
|
|
|
+ │ │ └── index.ts entry of Electron-main
|
|
|
|
+ │ └─┬ preload
|
2022-06-27 15:31:00 +08:00
|
|
|
+ │ └── splash.ts entry of Electron-preload
|
2022-06-16 19:35:21 +08:00
|
|
|
├─┬ src
|
|
|
|
│ └── main.ts entry of Electron-renderer
|
|
|
|
├── index.html
|
|
|
|
├── package.json
|
|
|
|
└── vite.config.ts
|
2021-11-11 18:29:18 +08:00
|
|
|
```
|
|
|
|
|
2022-06-28 10:25:37 +08:00
|
|
|
## 🚨 `dependencies` vs `devDependencies`
|
2022-03-13 21:52:58 +08:00
|
|
|
|
2022-06-28 10:25:37 +08:00
|
|
|
**Put Node.js packages in `dependencies`**
|
2022-03-13 21:52:58 +08:00
|
|
|
|
2022-06-28 10:25:37 +08:00
|
|
|
🚨 e.g.
|
|
|
|
|
|
|
|
- `electron-store`
|
|
|
|
- `sqlite3`
|
|
|
|
- `serilaport`
|
|
|
|
- `mongodb`
|
|
|
|
- ...others Node.js packages
|
|
|
|
|
|
|
|
**Put Web packages in `devDependencies`**
|
|
|
|
|
|
|
|
🚨 e.g.
|
|
|
|
|
|
|
|
- `vue`
|
|
|
|
- `vue-router`
|
|
|
|
- `vuex`
|
|
|
|
- `pinia`
|
|
|
|
- `element-plus`
|
|
|
|
- `ant-design-vue`
|
|
|
|
- `axios`
|
|
|
|
- ...others Web packages
|
|
|
|
|
|
|
|
**TODO: ESM packages**
|
|
|
|
|
|
|
|
- `node-fetch`
|
|
|
|
- `execa`
|
|
|
|
- ...others ESM packages
|
2021-12-18 09:44:36 +08:00
|
|
|
|
2022-06-27 10:28:05 +08:00
|
|
|
See more 👉 [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)
|