Skip to content

Commit

Permalink
Merge pull request electron-vite#195 from electron-vite/keep-love-220720
Browse files Browse the repository at this point in the history
Keep love 220720
  • Loading branch information
caoxiemeihao authored Jul 20, 2022
2 parents 14a0c9e + 2fb9477 commit ec5a9a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ npm create electron-vite
```diff
+ ├─┬ electron
+ │ ├─┬ main
+ │ │ └── index.ts entry of Electron-main
+ │ │ └── index.ts entry of Electron-Main
+ │ └─┬ preload
+ │ └── index.ts entry of Electron-preload
+ │ └── index.ts entry of Preload-Scripts
├─┬ src
│ └── main.ts entry of Electron-renderer
│ └── main.ts entry of Electron-Renderer
├── index.html
├── package.json
└── vite.config.ts
```

## 🚨 `dependencies` vs `devDependencies`
## 🚨

**Put Node.js packages in `dependencies`**
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/tree/main/packages/electron-renderer#config-presets-opinionated).

**e.g.** `electron-store` `sqlite3` `serilaport` `mongodb` ...others

**Put Web packages in `devDependencies`**

**e.g.** `vue` `vue-router` `vuex` `pinia` `element-plus` `ant-design-vue` `axios` ...others

See more 👉 [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)
```diff
# vite.config.ts

## 🚨 Node.js ESM packages
electron({
- renderer: {}
})
```

**e.g.** `node-fetch` `execa` `got` ...
## FAQ

[👉 Using Node.js ESM packages in Electron-Renderer](https://github.com/electron-vite/vite-plugin-electron-renderer#-nodejs-esm-packages)
- [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron/tree/main/packages/electron-renderer#dependencies-vs-devdependencies)
- [Using C/C++ native addons in Electron-Renderer](https://github.com/electron-vite/vite-plugin-electron/tree/main/packages/electron-renderer#load-nodejs-cc-native-modules)
- [Node.js ESM packages](https://github.com/electron-vite/vite-plugin-electron/tree/main/packages/electron-renderer#nodejs-esm-packages) (e.g. `execa` `node-fetch`)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"electron-builder": "^23.1.0",
"typescript": "^4.7.4",
"vite": "^2.9.13",
"vite-plugin-electron": "^0.7.5",
"vite-plugin-electron": "^0.8.0",
"vue": "^3.2.37",
"vue-tsc": "^0.38.3"
},
Expand Down

0 comments on commit ec5a9a6

Please sign in to comment.