chore(docs): UPDATE

This commit is contained in:
草鞋没号 2021-12-18 10:23:56 +08:00
parent c929aa6094
commit a113d7491f
2 changed files with 24 additions and 24 deletions

View File

@ -6,6 +6,19 @@
[![Required Node.JS >= v14.17.0](https://img.shields.io/static/v1?label=node&message=%3E=14.17.0&logo=node.js&color=3f893e&style=flat)](https://nodejs.org/about/releases)
**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
```bash
@ -61,19 +74,7 @@
|
```
## How to work
- 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
## Shown
<img width="400px" src="https://raw.githubusercontent.com/caoxiemeihao/blog/main/vite-react-electron/react-win.png" />

View File

@ -7,6 +7,16 @@
**[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
@ -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" />