{"id":13417488,"url":"https://github.com/alex8088/vite-plugin-electron-config","last_synced_at":"2025-04-12T21:11:45.751Z","repository":{"id":57690049,"uuid":"470870734","full_name":"alex8088/vite-plugin-electron-config","owner":"alex8088","description":"Electron plugin for Vite","archived":false,"fork":false,"pushed_at":"2022-04-02T09:24:15.000Z","size":23,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-22T00:19:25.746Z","etag":null,"topics":["electron","vite","vite-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex8088.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-17T06:15:50.000Z","updated_at":"2024-07-17T14:28:17.000Z","dependencies_parsed_at":"2022-09-26T20:53:02.278Z","dependency_job_id":null,"html_url":"https://github.com/alex8088/vite-plugin-electron-config","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fvite-plugin-electron-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fvite-plugin-electron-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fvite-plugin-electron-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Fvite-plugin-electron-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex8088","download_url":"https://codeload.github.com/alex8088/vite-plugin-electron-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631681,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","vite","vite-plugin"],"created_at":"2024-07-30T22:00:38.133Z","updated_at":"2025-04-12T21:11:45.725Z","avatar_url":"https://github.com/alex8088.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Electron"],"readme":"# vite-plugin-electron-config\n\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/electron-\u003e13.0.0-9feaf9.svg\" alt=\"electron\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/vite-\u003e2.0.0-747bff.svg\" alt=\"vite\" /\u003e\n\u003c/p\u003e\n\n\u003e Electron plugin for Vite\n\n---\n\n## Features\n\n- 🏠Presets for main process:\n  - **target**: `node*`, automatically match node target of `Electron`. For example, the node target of Electron 17 is `node16.13`\n  - **lib.entry**: `{index|main}.{js|ts|mjs|cjs}`(relative to root from vite config file), empty string if not found\n  - **lib.formats**: `cjs`\n  - **rollupOptions.external**: `electron` and all builtin modules, and it will merge automatically with the external module ids added by user\n- 🔗Presets for preload script:\n  - **target**: the same as `main`\n  - **lib.entry**: `{index|preload}.{js|ts|mjs|cjs}`(relative to root from vite config file), empty string if not found\n  - **lib.formats**: `cjs`\n  - **rollupOptions.external**: the same as `main`\n- 🌴Presets for renderer process:\n  - **target**: `chrome*`, automatically match chrome target of `Electron`. For example, the chrome target of Electron 17 is `chrome98`\n  - **polyfillModulePreload**: `false`, there is no need to polyfill `Module Preload` for the Electron renderer\n  - **rollupOptions.external**: the same as `main`\n- 🔧Resolved config checking\n\n## Install\n\n```sh\nnpm i vite-plugin-electron-config -D\n```\n\n## Usage\n\n### Main Process\n\n```js\nimport { defineConfig } from 'vite'\nimport { electronMain } from 'vite-plugin-electron-config'\n\nexport default defineConfig({\n  plugins: [electronMain()]\n})\n```\n\n### Preload Script\n\n```js\nimport { defineConfig } from 'vite'\nimport { electronPreload } from 'vite-plugin-electron-config'\n\nexport default defineConfig({\n  plugins: [electronPreload()]\n})\n```\n\n### Renderer Process\n\n```js\nimport { defineConfig } from 'vite'\nimport { electronRenderer } from 'vite-plugin-electron-config'\n\nexport default defineConfig({\n  plugins: [electronRenderer()]\n})\n```\n\n## Recommended\n\n[electron-vite](https://github.com/alex8088/electron-vite), an Electron CLI integrated with Vite, make you easy to use Vite.\n\n## License\n\n[MIT](./LICENSE) License © 2022 Alex Wei\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Fvite-plugin-electron-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex8088%2Fvite-plugin-electron-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Fvite-plugin-electron-config/lists"}