chore(docs): UPDATE
This commit is contained in:
parent
c929aa6094
commit
a113d7491f
27
README.md
27
README.md
|
@ -6,6 +6,19 @@
|
||||||
[](https://nodejs.org/about/releases)
|
[](https://nodejs.org/about/releases)
|
||||||
|
|
||||||
**English | [简体中文](README.zh-CN.md)**
|
**English | [简体中文](README.zh-CN.md)**
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
- All config files `Main-process`, `Renderer-process` and `Preload-script` they are in `configs/*.ts`.
|
||||||
|
|
||||||
|
- All files are built using `Vite`, is supper fast.
|
||||||
|
|
||||||
|
- `scripts/build.mjs` just calls the `Vite` API and uses the `configs/*.ts` config file to build.
|
||||||
|
|
||||||
|
- The difference between `scripts/watch.mjs` and `build.mjs` is that the watch option is configured for the Main-process and Preload-script. The Renderer-process uses `require ('vite').createServer`
|
||||||
|
|
||||||
|
- Manage projects more through configuration other than scripts. -- **🥳 Simple and clearly**
|
||||||
|
|
||||||
## Run Setup
|
## Run Setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -61,19 +74,7 @@
|
||||||
|
|
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to work
|
## Shown
|
||||||
|
|
||||||
- The `Main-process`, `Renderer-process` and `Preload-script` are all config in `configs/xxx.ts`.
|
|
||||||
|
|
||||||
- All files are built using `Vite`, is supper fast.
|
|
||||||
|
|
||||||
- `scripts/build.mjs` only calls the `Vite` API and uses the `configs/xxx.ts` config file to build.
|
|
||||||
|
|
||||||
- The difference between `scripts/watch.mjs` and `build.mjs` is that the watch option is configured for the Main-process and Preload-script. The Renderer-process uses `require ('vite').createServer`
|
|
||||||
|
|
||||||
- Manage projects more through configuration other than scripts. -- **🥳 Simple and clearly**
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
<img width="400px" src="https://raw.githubusercontent.com/caoxiemeihao/blog/main/vite-react-electron/react-win.png" />
|
<img width="400px" src="https://raw.githubusercontent.com/caoxiemeihao/blog/main/vite-react-electron/react-win.png" />
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,16 @@
|
||||||
|
|
||||||
**[English](README.md) | 简体中文**
|
**[English](README.md) | 简体中文**
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
- 主进程(main-process)、渲染进程(renderer-process)、预加载脚本(preload-script) 全部在 `configs/xxx.ts` 中配置 -- 全量级的 `Vite` 编译还是相当快的
|
||||||
|
|
||||||
|
- `scripts/build.mjs` 只是调用了 `Vite` 的 API 并使用 `configs/xxx.ts` 配置文件进行构建
|
||||||
|
|
||||||
|
- `scripts/watch.mjs` 与 `build.mjs` 区别是 主进程(main-process)、预加载脚本(preload-script) 配置了 `watch` 选项;渲染进程则是使用了 `require('vite').createServer`
|
||||||
|
|
||||||
|
- 项目整体趋于 配置化 而不是大量的脚本让人眼花缭乱 -- **上手简单**
|
||||||
|
|
||||||
## 运行
|
## 运行
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -62,17 +72,6 @@
|
||||||
|
|
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 原理
|
|
||||||
|
|
||||||
- 主进程(main-process)、渲染进程(renderer-process)、预加载脚本(preload-script) 全部在 `configs/xxx.ts` 中配置 -- 全量级的 `Vite` 编译还是相当快的
|
|
||||||
|
|
||||||
- `scripts/build.mjs` 只是调用了 `Vite` 的 API 并使用 `configs/xxx.ts` 配置文件进行构建
|
|
||||||
|
|
||||||
- `scripts/watch.mjs` 与 `build.mjs` 区别是 主进程(main-process)、预加载脚本(preload-script) 配置了 `watch` 选项;渲染进程则是使用了 `require('vite').createServer`
|
|
||||||
|
|
||||||
- 项目整体趋于 配置化 而不是大量的脚本让人眼花缭乱 -- **上手简单**
|
|
||||||
|
|
||||||
|
|
||||||
## 效果
|
## 效果
|
||||||
|
|
||||||
<img width="400px" src="https://raw.githubusercontent.com/caoxiemeihao/blog/main/vite-react-electron/react-win.png" />
|
<img width="400px" src="https://raw.githubusercontent.com/caoxiemeihao/blog/main/vite-react-electron/react-win.png" />
|
||||||
|
|
Loading…
Reference in New Issue