# vite-electron **Repository Path**: openaddr/vite-electron ## Basic Information - **Project Name**: vite-electron - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-21 - **Last Updated**: 2023-11-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vite-electron 1. 此项目是vue3结合electron进行桌面打包和开发的模板项目 2. 此分支**请勿提交代码** 3. 请**fork(派生)** 此项目,以使用此模板开始开发 4. 主要修改的文件为: 1. vite.config.ts 2. src/background.ts 3. plugins/vite.electron.dev.ts 4. plugins/vite.electron.build.ts 5. electron开发/打包环境已配置好,只需要正常编写vue代码即可 ## 安装依赖 ```shell npm install ``` ## 开发环境启动 ```shell npm run dev ``` 已实现热部署,vue内容变更后,electron进程会重启 ## 打包 ```shell npm run build ``` 打包后的安装包在release路径下; plugins/vite.electron.build.ts 文件中,第42/43行可以设置app信息 appId: 'com.example.app', //组织名 productName: 'vite-electron', //应用名 **** 以下内容为工程自动生成的ReadMe文档,仅可作参考 # vue-project This template should help get you started developing with Vue 3 in Vite. ## Recommended IDE Setup [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). ## Type Support for `.vue` Imports in TS TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: 1. Disable the built-in TypeScript Extension 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. ## Customize configuration See [Vite Configuration Reference](https://vitejs.dev/config/). ## Project Setup ```sh npm install ``` ### Compile and Hot-Reload for Development ```sh npm run dev ``` ### Type-Check, Compile and Minify for Production ```sh npm run build ``` ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh npm run test:unit ``` ### Run End-to-End Tests with [Cypress](https://www.cypress.io/) ```sh npm run test:e2e:dev ``` This runs the end-to-end tests against the Vite development server. It is much faster than the production build. But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments): ```sh npm run build npm run test:e2e ``` ### Lint with [ESLint](https://eslint.org/) ```sh npm run lint ```