{"id":21470850,"url":"https://github.com/fujia-cli/electron-webpack-react-template","last_synced_at":"2025-09-01T00:33:26.028Z","repository":{"id":57112963,"uuid":"449936589","full_name":"fujia-cli/electron-webpack-react-template","owner":"fujia-cli","description":"A template for electron and build with webpack \u0026 react.","archived":false,"fork":false,"pushed_at":"2022-06-18T09:25:02.000Z","size":754,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-26T01:48:15.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/fujia-cli.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-01-20T03:09:04.000Z","updated_at":"2022-05-04T09:04:12.000Z","dependencies_parsed_at":"2022-08-21T22:10:48.317Z","dependency_job_id":null,"html_url":"https://github.com/fujia-cli/electron-webpack-react-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujia-cli%2Felectron-webpack-react-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujia-cli%2Felectron-webpack-react-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujia-cli%2Felectron-webpack-react-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fujia-cli%2Felectron-webpack-react-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fujia-cli","download_url":"https://codeload.github.com/fujia-cli/electron-webpack-react-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243988956,"owners_count":20379649,"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":[],"created_at":"2024-11-23T09:29:30.071Z","updated_at":"2025-03-17T06:45:00.422Z","avatar_url":"https://github.com/fujia-cli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/fujia-cli/electron-webpack-react-template\" target=\"_blank\"\u003e\n    \u003cimg alt=\"logo\" width=\"200\" src=\"./resource/unrelease/png/256x256.png\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e@fujia/electron-webpack-react-template\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nA template for electron and build with webpack \u0026 react.\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n\u003c/div\u003e\n\n## Getting started\n\nAt first, you can install the cli tools by following commands:\n\n```sh\nnpm i -g @fujia/cli-core\n\n# or using yarn\nyarn global add @fujia/cli-core\n```\n\nthen, to initial a project with the template via above cli tools:\n\n```sh\n# step1. create project folder\nmkdir [project name]; cd $_;\n\n# step2. initial project via the template\nstage init\n\n# step3. select \"default\" option.\n\n# step4. select \"app\" option.\n\n# step5. entering project name and version.\n\n# step3. select \"electron-react-webpack\" option.\n```\n\nof course, if you don't want to install @fujia/cli-core in global scope, it can initial a project quickly by following commands:\n\n```sh\n# step1. create project folder\nmkdir [project name]; cd $_;\n\n# step2. initial project via the template\nnpm init stage@latest\n\n# the other steps follow above.\n```\n\nThat's all, the project will install the dependencies and devDependencies, then running automatically.\n\n### Starting Development\n\n1. Start the app in the dev environment:\n\n```sh\nnpm start\n```\n\n2. To package apps for the local platform by following command:\n\n```sh\nnpm run release\n```\n\nhowever, please note that the project should have a git repository， otherwise， the above command will fail. By default, it's github, you can see the file `scripts/release/index.js`:\n\n```js\nconst release = {\n  // ...\n  buildInstaller() {\n    // ...\n    publish: {\n      provider: 'github',\n      repo: '',\n      releaseType: 'release',\n      // token: process.env.GH_TOKEN,\n    },\n    publish: 'always',\n    // ...\n  }\n}\n```\n\nyou can add remote github repository manually, or using the following command:\n\n```sh\nstage publish\n```\n\n\u003e tips：if you have installed cli tools of @fujia/cli-core, the stage command is available in the global scope.\n\n3. Build unpacked dir which useful to test.\n\n```sh\nnpm run pack\n```\n\n## Notes\n\nBy default, we have disabled node integration, why? [seeing here](https://www.electronjs.org/docs/latest/tutorial/security#2-do-not-enable-nodejs-integration-for-remote-content)\n\nif you want to enable the option or use native modules, please make the following changes:\n\nwebpack.config.renderer.base.js\n\n```js\n- target: ['web', 'electron-renderer'],\n+ target: 'electron-renderer',\n\n- library: {\n-  type: 'umd',\n- },\n```\n\nwebpack.config.main.prod.js\n\n```js\nentry: {\n   main: srcMainEntryPath,\n-  preload: srcMainPreloadPath,\n},\n```\n\nmain.ts\n\n```ts\nwebPreferences: {\n+  nodeIntegration: true,\n+  contextIsolation: false,\n-  preload: app.isPackaged\n-    ? path.join(__dirname, 'preload.js')\n-    : path.join(__dirname, '../../release/bundled/preload.js'),\n},\n```\n\n## Maintainers\n\n- [fujia](https://github.com/fushenguang)\n\n## License\n\nMIT © [electron-webpack-react-template](https://github.com/fujia-cli/electron-webpack-react-template)\n\n## References\n\n1. 《深入浅出 Electron：原理、工程与实践》\n\n2. [electron-react-boilerplate](https://electron-react-boilerplate.js.org/docs/installation/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffujia-cli%2Felectron-webpack-react-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffujia-cli%2Felectron-webpack-react-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffujia-cli%2Felectron-webpack-react-template/lists"}