Skip to content

Commit

Permalink
Merge pull request #49 from electron-vite/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
caoxiemeihao authored Sep 6, 2023
2 parents 26800b0 + 37176fd commit 6094cb7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 44 deletions.
10 changes: 7 additions & 3 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export default defineConfig({
logo: '/electron-vite.svg',
nav: [
{ text: 'Guide', link: '/guide/why-electron-vite' },
{
text: 'Examples',
link: 'https://github.com/caoxiemeihao/electron-vite-samples',
},
{
text: 'Template', items: [
{
Expand All @@ -31,8 +35,8 @@ export default defineConfig({
{
text: 'electron-vite-react',
link: 'https://github.com/electron-vite/electron-vite-react'
}
]
},
],
},
],
sidebar: [
Expand All @@ -44,8 +48,8 @@ export default defineConfig({
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Features', link: '/guide/features' },
{ text: 'Plugins', link: '/guide/plugins' },
{ text: 'Templates', link: '/guide/templates' },
{ text: 'Examples', link: '/guide/examples' },
{ text: 'Templates', link: '/guide/templates' },
],
},
{
Expand Down
52 changes: 14 additions & 38 deletions build/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,49 @@ The templates currently used are packaged and built using [electron-builder](htt

## electron-builder.json5

### Main Config

```json5
/**
* @see https://www.electron.build/configuration/configuration
*/
{
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
"appId": "YourAppID",
"productName":"YourAppName",
"asar": true,
"asar": false,
"productName": "YourAppName",
"directories": {
"output": "release/${version}"
},
"files": [
"dist-electron",
"dist"
"dist",
"dist-electron"
],
"linux": {
"icon": "public/icon.png",
},
"mac": {
"artifactName": "${productName}_${version}.${ext}",
"icon": "public/icon.icns",
"target": [
"dmg"
]
},
"win": {
"icon": "public/icon.ico",
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
"arch": ["x64"]
}
],
"artifactName": "${productName}_${version}.${ext}"
"artifactName": "${productName}-Windows-${version}-Setup.${ext}"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
},
"mac": {
"target": ["dmg"],
"artifactName": "${productName}-Mac-${version}-Installer.${ext}"
},
"linux": {
"target": ["AppImage"],
"artifactName": "${productName}-Linux-${version}.${ext}"
}
}
```

---

### Details

#### $schema

This is a JSON architecture file used to check the correctness of the configuration file. Usually, you don't need to change it.
<details>
<summary>
中文
</summary>
这是一个 JSON 架构文件,用于检查配置文件的正确性。通常情况下,您不需要改变它。
</details>

---

#### appId

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

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


2 changes: 1 addition & 1 deletion build/electron-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

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

TODO:
See the 👉 [Electron Forge Vite](https://www.electronforge.io/templates/vite) docs.
13 changes: 11 additions & 2 deletions guide/examples.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
## Examples

- [Multiple BrowserWindow](https://github.com/electron-vite/vite-plugin-electron/tree/v0.12.0/examples/multiple-window)
- [Web worker in Renderer process](https://github.com/electron-vite/vite-plugin-electron-renderer/tree/v0.14.5/examples/worker)
**[👉 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.

This is really helpful for someone who is new to [Electron⚡️Vite](https://github.com/electron-vite).

<details>
<summary>中文</summary>
<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>

<p>这对一个 <a target="_blank" href="https://github.com/electron-vite">Electron⚡️Vite</a> 新手来说非常的有帮助。</p>
</details>

0 comments on commit 6094cb7

Please sign in to comment.