{"id":13614106,"url":"https://github.com/alex8088/electron-vite-bytecode-example","last_synced_at":"2025-10-04T05:01:28.845Z","repository":{"id":103578629,"uuid":"538461160","full_name":"alex8088/electron-vite-bytecode-example","owner":"alex8088","description":"electron-vite source code protection example","archived":false,"fork":false,"pushed_at":"2023-09-07T16:50:14.000Z","size":296,"stargazers_count":26,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T00:50:41.340Z","etag":null,"topics":["electron","protection","source-code","vite"],"latest_commit_sha":null,"homepage":"https://electron-vite.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alex8088.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-19T11:06:25.000Z","updated_at":"2025-09-27T00:37:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7db3dbc-1a52-4b7b-9f1c-c213dfd22bbc","html_url":"https://github.com/alex8088/electron-vite-bytecode-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alex8088/electron-vite-bytecode-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Felectron-vite-bytecode-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Felectron-vite-bytecode-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Felectron-vite-bytecode-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Felectron-vite-bytecode-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex8088","download_url":"https://codeload.github.com/alex8088/electron-vite-bytecode-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex8088%2Felectron-vite-bytecode-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","protection","source-code","vite"],"created_at":"2024-08-01T20:00:57.044Z","updated_at":"2025-10-04T05:01:28.746Z","avatar_url":"https://github.com/alex8088.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# electron-vite-bytecode-example\n\n![electron version](https://img.shields.io/github/package-json/dependency-version/alex8088/electron-vite-bytecode-example/dev/electron)\n![electron vite version](https://img.shields.io/github/package-json/dependency-version/alex8088/electron-vite-bytecode-example/dev/electron-vite)\n\n\u003e electron-vite source code protection example\n\n---\n\n[Check out the documentation to learn more](https://electron-vite.org/guide/source-code-protection.html).\n\n## Repo Setup\n\nClone this repo to your local machine and install the dependencies.\n\n```bash\npnpm i\n```\n\n## Run Tests\n\n### Fully\n\nCompile the main process and preload scripts source code to v8 bytecode.\n\nConfigure with [electron.vite.config.ts](./electron.vite.config.ts), run:\n\n```\npnpm test:fully\n```\n\nresult:\n\n```bash\n.\n├──out /\n│  ├──main /\n│  │  ├──bytecode-loader.js # bytecode loader\n│  │  ├──foo2.82d22e54.jsc  # dynamic import chunk bytecode file\n│  │  ├──index.js           # entry file for electron\n│  │  └──index.jsc          # main chunk bytecode file\n│  ├──preload /\n│  │  ├──bytecode-loader.js # bytecode loader\n│  │  ├──index.js           # preload script entry\n│  │  └──index.jsc          # preload script chunk bytecode file\n│  └──renderer\n├──...\n└──package.json\n```\n\n### Protect Foo\n\nOnly compile `src/main/foo1.ts` and `src/main/foo2.ts` source code to v8 bytecode.\n\nConfigure with [electron.vite.config.foo.ts](./electron.vite.config.foo.ts), run:\n\n```\npnpm test:foo\n```\n\nresult:\n\n```bash\n.\n├──out /\n│  ├──main /\n│  │  ├──bytecode-loader.js # bytecode loader\n│  │  ├──foo.bafa5d6e.jsc   # foo1.ts and foo2.ts chunk bytecode file\n│  │  └──index.js           # main chunk\n│  ├──preload\n│  └──renderer\n├──...\n└──package.json\n```\n\n### Assert Async Arrow Function Bug\n\nWithout transform arrow functions(the `transformArrowFunctions` option set `false`).\n\nConfigure with [electron.vite.config.bug.ts](./electron.vite.config.bug.ts) and `test` mode, run:\n\n```\npnpm test:bug\n```\n\nresult:\n\nThe Electron app will crash without any error message.\n\n### Fix Async Arrow Function Bug\n\nSet `transformArrowFunctions` option to `true`.\n\nConfigure with [electron.vite.config.ts](./electron.vite.config.ts) and `test` mode, run:\n\n```\npnpm test:fixes\n```\n\nresult:\n\nThe Electron will launch normally and get the error message.\n\n\n### Keep Bundles\n\nSet `removeBundleJS` option to `false`, keep bundle files which compiled as bytecode files.\n\nConfigure with [electron.vite.config.keep.ts](./electron.vite.config.keep.ts), run:\n\n```\npnpm test:keep\n```\n\nresult:\n\n```bash\n.\n├──out /\n│  ├──main /\n│  │  ├──_foo2.82d22e54.js  # dynamic import chunk\n│  │  ├──_index.js          # main chunk\n│  │  ├──bytecode-loader.js # bytecode loader\n│  │  ├──foo2.82d22e54.jsc  # dynamic import chunk bytecode file\n│  │  ├──index.js           # entry file for electron\n│  │  └──index.jsc          # main chunk bytecode file\n│  ├──preload\n│  └──renderer\n├──...\n└──package.json\n```\n\n### Multiple Entries\n\nConfigure with [electron.vite.config.multi.ts](./electron.vite.config.multi.ts), run:\n\n```\npnpm test:multi\n```\n\nresult:\n\n```bash\n.\n├──out /\n│  ├──main\n│  ├──preload /\n│  │  ├──bytecode-loader.js # bytecode loader\n│  │  ├──index.js           # index entry file\n│  │  ├──index.jsc          # index chunk bytecode file\n│  │  └──webview.jsc        # webview entry file\n│  └──renderer\n├──...\n└──package.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Felectron-vite-bytecode-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex8088%2Felectron-vite-bytecode-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex8088%2Felectron-vite-bytecode-example/lists"}