Skip to content

Commit 6094cb7

Browse files
authored
Merge pull request #49 from electron-vite/dev
Dev
2 parents 26800b0 + 37176fd commit 6094cb7

File tree

4 files changed

+33
-44
lines changed

4 files changed

+33
-44
lines changed

.vitepress/config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export default defineConfig({
2222
logo: '/electron-vite.svg',
2323
nav: [
2424
{ text: 'Guide', link: '/guide/why-electron-vite' },
25+
{
26+
text: 'Examples',
27+
link: 'https://github.com/caoxiemeihao/electron-vite-samples',
28+
},
2529
{
2630
text: 'Template', items: [
2731
{
@@ -31,8 +35,8 @@ export default defineConfig({
3135
{
3236
text: 'electron-vite-react',
3337
link: 'https://github.com/electron-vite/electron-vite-react'
34-
}
35-
]
38+
},
39+
],
3640
},
3741
],
3842
sidebar: [
@@ -44,8 +48,8 @@ export default defineConfig({
4448
{ text: 'Getting Started', link: '/guide/getting-started' },
4549
{ text: 'Features', link: '/guide/features' },
4650
{ text: 'Plugins', link: '/guide/plugins' },
47-
{ text: 'Templates', link: '/guide/templates' },
4851
{ text: 'Examples', link: '/guide/examples' },
52+
{ text: 'Templates', link: '/guide/templates' },
4953
],
5054
},
5155
{

build/electron-builder.md

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,49 @@ The templates currently used are packaged and built using [electron-builder](htt
44

55
## electron-builder.json5
66

7-
### Main Config
8-
97
```json5
108
/**
119
* @see https://www.electron.build/configuration/configuration
1210
*/
1311
{
14-
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
1512
"appId": "YourAppID",
16-
"productName":"YourAppName",
17-
"asar": true,
13+
"asar": false,
14+
"productName": "YourAppName",
1815
"directories": {
1916
"output": "release/${version}"
2017
},
2118
"files": [
22-
"dist-electron",
23-
"dist"
19+
"dist",
20+
"dist-electron"
2421
],
25-
"linux": {
26-
"icon": "public/icon.png",
27-
},
28-
"mac": {
29-
"artifactName": "${productName}_${version}.${ext}",
30-
"icon": "public/icon.icns",
31-
"target": [
32-
"dmg"
33-
]
34-
},
3522
"win": {
36-
"icon": "public/icon.ico",
3723
"target": [
3824
{
3925
"target": "nsis",
40-
"arch": [
41-
"x64"
42-
]
26+
"arch": ["x64"]
4327
}
4428
],
45-
"artifactName": "${productName}_${version}.${ext}"
29+
"artifactName": "${productName}-Windows-${version}-Setup.${ext}"
4630
},
4731
"nsis": {
4832
"oneClick": false,
4933
"perMachine": false,
5034
"allowToChangeInstallationDirectory": true,
5135
"deleteAppDataOnUninstall": false
36+
},
37+
"mac": {
38+
"target": ["dmg"],
39+
"artifactName": "${productName}-Mac-${version}-Installer.${ext}"
40+
},
41+
"linux": {
42+
"target": ["AppImage"],
43+
"artifactName": "${productName}-Linux-${version}.${ext}"
5244
}
5345
}
5446
```
5547

5648
---
5749

58-
### Details
59-
60-
#### $schema
61-
62-
This is a JSON architecture file used to check the correctness of the configuration file. Usually, you don't need to change it.
63-
<details>
64-
<summary>
65-
中文
66-
</summary>
67-
这是一个 JSON 架构文件,用于检查配置文件的正确性。通常情况下,您不需要改变它。
68-
</details>
69-
70-
---
71-
7250
#### appId
7351

7452
The unique identifier of an application.
@@ -244,5 +222,3 @@ Windows平台特定的 NSIS 配置。
244222
## More
245223

246224
If you want to know more about the configuration, please refer to the [electron-build/configuration](https://www.electron.build/configuration/configuration) documentation.
247-
248-

build/electron-forge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
[Electron Forge](https://www.electronforge.io/) is recommended because it is the official Electron build tool maintained by [Electron](https://www.electronjs.org/).
44

5-
TODO:
5+
See the 👉 [Electron Forge Vite](https://www.electronforge.io/templates/vite) docs.

guide/examples.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
## Examples
22

3-
- [Multiple BrowserWindow](https://github.com/electron-vite/vite-plugin-electron/tree/v0.12.0/examples/multiple-window)
4-
- [Web worker in Renderer process](https://github.com/electron-vite/vite-plugin-electron-renderer/tree/v0.14.5/examples/worker)
3+
**[👉 electron-vite-samples](https://github.com/caoxiemeihao/electron-vite-samples)** maintains a lot of boilerplate samples, it includes the really confusing `C/C++` modules like [better-sqlite3](https://www.npmjs.com/package/better-sqlite3), [sqlite3](https://www.npmjs.com/package/sqlite3), [serialport](https://www.npmjs.com/package/serialport). There are also npm packages in `esmodule` format, like [node-fetch](https://www.npmjs.com/package/node-fetch), [got](https://www.npmjs.com/package/got) etc.
4+
5+
This is really helpful for someone who is new to [Electron⚡️Vite](https://github.com/electron-vite).
6+
7+
<details>
8+
<summary>中文</summary>
9+
<p><a target="_blank" href="https://github.com/caoxiemeihao/electron-vite-samples">👉 electron-vite-samples</a> 维护了很多样板示例, 它包括让人非常困扰的 <code>C/C++</code> 模块像 <a target="_blank" href="https://www.npmjs.com/package/better-sqlite3">better-sqlite3</a>, <a target="_blank" href="https://www.npmjs.com/package/sqlite3">sqlite3</a>, <a target="_blank" href="https://www.npmjs.com/package/serialport">serialport</a>。 还有 <code>esmodule</code> 格式的 npm 包像 <a target="_blank" href="https://www.npmjs.com/package/node-fetch">node-fetch</a>, <a target="_blank" href="https://www.npmjs.com/package/got">got</a> 等等。</p>
10+
11+
<p>这对一个 <a target="_blank" href="https://github.com/electron-vite">Electron⚡️Vite</a> 新手来说非常的有帮助。</p>
12+
</details>
13+

0 commit comments

Comments
 (0)