electron-vite-vue/README.md

74 lines
2.9 KiB
Markdown
Raw Normal View History

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-11-21 09:07:33 +08:00
<!-- [![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite) -->
<!-- [![Netlify Status](https://api.netlify.com/api/v1/badges/ae3863e3-1aec-4eb1-8f9f-1890af56929d/deploy-status)](https://app.netlify.com/sites/electron-vite/deploys) -->
<!-- [![GitHub license](https://img.shields.io/github/license/caoxiemeihao/electron-vite-vue)](https://github.com/electron-vite/electron-vite-vue/blob/main/LICENSE) -->
<!-- [![GitHub stars](https://img.shields.io/github/stars/caoxiemeihao/electron-vite-vue?color=fa6470)](https://github.com/electron-vite/electron-vite-vue) -->
<!-- [![GitHub forks](https://img.shields.io/github/forks/caoxiemeihao/electron-vite-vue)](https://github.com/electron-vite/electron-vite-vue) -->
2022-07-27 18:45:22 +08:00
[![GitHub Build](https://github.com/electron-vite/electron-vite-vue/actions/workflows/build.yml/badge.svg)](https://github.com/electron-vite/electron-vite-vue/actions/workflows/build.yml)
2022-11-21 09:07:33 +08:00
[![GitHub Discord](https://img.shields.io/badge/chat-discord-blue?logo=discord)](https://discord.gg/sRqjYpEAUK)
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-08-03 08:18:24 +08:00
🎯 Based on the official [template-vue-ts](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-vue-ts), less invasive
2022-06-17 09:01:16 +08:00
🌱 Extensible, really simple directory structure
💪 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
2023-04-23 09:48:03 +08:00
![electron-vite-vue.gif](/electron-vite-vue.gif)
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
2023-04-23 09:48:03 +08:00
![electron-vite-react-debug.gif](https://github.com/electron-vite/electron-vite-react/blob/main/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
2022-07-20 08:47:41 +08:00
+ │ │ └── index.ts entry of Electron-Main
2022-06-16 19:35:21 +08:00
+ │ └─┬ preload
2022-07-20 08:47:41 +08:00
+ │ └── index.ts entry of Preload-Scripts
2022-06-16 19:35:21 +08:00
├─┬ src
2022-07-20 08:47:41 +08:00
│ └── main.ts entry of Electron-Renderer
2022-06-16 19:35:21 +08:00
├── index.html
├── package.json
└── vite.config.ts
2021-11-11 18:29:18 +08:00
```
2023-04-17 09:51:41 +08:00
<!--
2022-08-11 08:58:59 +08:00
## Be aware
2022-12-09 09:10:56 +08:00
🚨 By default, this template integrates Node.js in the Renderer process. If you don't need it, you just remove the option below. [Because it will modify the default config of Vite](https://github.com/electron-vite/vite-plugin-electron-renderer#config-presets-opinionated).
2022-07-20 08:47:41 +08:00
```diff
# vite.config.ts
2022-10-18 16:36:56 +08:00
export default {
plugins: [
- // Use Node.js API in the Renderer-process
- renderer({
- nodeIntegration: true,
- }),
],
}
2022-07-20 08:47:41 +08:00
```
2023-04-17 09:51:41 +08:00
-->
2022-07-20 08:47:41 +08:00
## FAQ
2022-11-16 08:09:51 +08:00
- [C/C++ addons, Node.js modules - Pre-Bundling](https://github.com/electron-vite/vite-plugin-electron-renderer#dependency-pre-bundling)
2023-04-17 09:51:41 +08:00
- [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)