From 8a13804dfc26c47865aeb7c006bc95ae3305c1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Thu, 27 Jan 2022 16:08:44 +0800 Subject: [PATCH] docs: update --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 21630f0..377f355 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,10 @@ Once `dev` or `build` npm-script executed will be generate named `dist` folder. ## Use SerialPort, SQLite3 or other node-native addons in Main-process -Main-process, Preload-script are also built with Vite, and they are just built as [build.lib](https://vitejs.dev/config/#build-lib). -So they just need to configure Rollup. +- First, yout need to make sure the deps in "dependencies". Because the project still needs it after packaged. + +- Main-process, Preload-script are also built with Vite, and they are just built as [build.lib](https://vitejs.dev/config/#build-lib). +So they just need to configure Rollup. **Click to view more** 👉 [scripts/vite.config.mjs](https://github.com/caoxiemeihao/electron-vue-vite/blob/main/scripts/vite.config.mjs) @@ -124,11 +126,11 @@ export default { ## `dependencies` vs `devDependencies` -- First, you need to know if deps(npm package) are still needed after packaged. +- First, you need to know if deps(npm package) are still needed after packaged. -- Like [serialport](https://www.npmjs.com/package/serialport), [sqlite3](https://www.npmjs.com/package/sqlite3) they are node-native module and should be placed in `dependencies`. +- Like [serialport](https://www.npmjs.com/package/serialport), [sqlite3](https://www.npmjs.com/package/sqlite3) they are node-native module and should be placed in `dependencies`. In addition, Vite will not build them, but treat them as external modules. -- Like [vue](https://www.npmjs.com/package/vue), [react](https://www.npmjs.com/package/react) they are pure javascript module and can be built with Vite, so they can be placed in `devDependencies`. This reduces the volume of the built project. +- Like [vue](https://www.npmjs.com/package/vue), [react](https://www.npmjs.com/package/react) they are pure javascript module and can be built with Vite, so they can be placed in `devDependencies`. This reduces the volume of the built project. ## Main window