11# Electron-React-TypeScript-Webpack-Boilerplate
22Pre-configured Electron.js + React.js + TypeScript boilerplate with
3- Webpack v4 & linters config predefined.
3+ Webpack v5 & linters config predefined.
44
55This boilerplate currently works on macOS and Windows. If something doesn't
6- work, please [ file and issue] ( https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/new ) .
6+ work, please [ file an issue] ( https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/new ) .
77
88## Getting started
99``` sh
@@ -20,7 +20,7 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
2020 "build" : {
2121 "appId" : your-app-id,
2222 "productName" : your-product-name,
23- "buildVersion" : whatever-you-like
23+ "buildVersion" : your-build-number
2424 },
2525 "author" : who's-the-author?,
2626 "license" : if-you-don't-want-to-use-MIT,
@@ -34,7 +34,7 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
3434Then install all the ` node_modules ` needed by executing the following command:
3535``` sh
3636cd folder-containing-the-cloned-boilerplate
37- npm install
37+ npm install --also-dev
3838```
3939
4040Finally execute the following command to start Webpack in development mode and
@@ -55,17 +55,19 @@ your app for macOS & Windows using `electron-builder`.
5555
5656For macOS, execute:
5757``` sh
58+ npm run prod
5859npm run build:mac
5960```
6061
6162For Windows, execute:
6263``` sh
64+ npm run prod
6365npm run build:win
6466```
65- _ ** ` asar ` archiving is disabled by default in Windows build as it can cause
66- errors while running the installed Electron app based on pervious experiences,
67- whereas the macOS build with ` asar ` enabled works just fine. You can turn it
68- back on by removing line 23 ( ` "asar": false ` ) in ` package.json ` . ** _
67+ _ ** ` asar ` archiving may cause errors while running the installed Electron app
68+ based on pervious experiences, whereas the macOS build with ` asar ` enabled
69+ works just fine. You can turn it off by changing ` asar ` to ` false ` in
70+ ` package.json ` line 26. ** _
6971
7072### Extra options
7173The build scripts are pre-configured to build 64 bit installers since 64 bit
@@ -93,17 +95,22 @@ build scripts in `package.json`, but those aren't tested yet. For details,
9395please refer to [ documents of ` electron-builder ` ] ( https://www.electron.build/cli ) .
9496
9597## Known issues
96-
97- - ` dmg ` build action on ` macOS Catalina (10.15) ` fails due to Apple ditches
98- support for 32-bit apps from ` 10.15 ` onwards (Don't worry, you are still
99- building 64-bit apps, just some dependencies of the builder are still 32-bit).
100- Further details retailed to this issue can be found
101- [ here] ( https://github.com/electron-userland/electron-builder/issues/3990 ) .
102- Application installer built on ` macOS ` is now set to build ` pkg ` file
103- instead of ` dmg ` as a workaround in the current version. The issue can be
104- fixed by applying a major version upgrade of ` electron-builder ` to ` 21.2.0+ `
105- but it hasn't been tested on this boilerplate yet. This issue is planned to
106- be addressed alongside with major version upgrades on other dependencies.
98+ 1 . As Apple introduced the [ notarization requirements] with the public release
99+ of ` macOS 10.14.5 ` , apps built for ` macOS ` are now needed to be signed with
100+ a valid Developer ID certificate and let Apple notarizes it for you. This
101+ boilerplate doesn't include the notarization setup as of the ` 3.0.0 ` release,
102+ but up until now, you should still be able to run your Electron app by
103+ allowing your app to be opened in `System Preferences -> Security & Privacy
104+ -> General` without notarizing it for still (tested on ` macOS 11.1`).
105+
106+ If you want to notarization your app using this boilerplate before those
107+ settings are included in the future updates, you can try follow the guides on
108+ issue [ electron-builder #3870 ] .
109+
110+ 2 . [ ` [email protected] ` ] added Apple Silicon and universal binary
111+ supports, but it's still a pre-release instead of a stable one so the one
112+ included in this boilerplate is still staying on ` 22.9.1 ` which doesn't
113+ support building the universal binary yet.
107114
108115## Folder structure
109116```
@@ -127,14 +134,22 @@ electron-react-typescript-base-proj/
127134| - package-lock.json
128135| - package.json
129136| - tsconfig.json //- TypeScript config
130- | - tslint.json //- TSLint config
131137| - webpack.config.js //- Webpack config
132138```
133139
134140## Author
135-
136141[ Wing Chau] ( https://github.com/iamWing ) [ @Devtography ] ( https://github.com/Devtography )
137142
143+ ## Donation
144+ I do this open source work for free in my free time. If you'd like me to invest
145+ more time on it, please consider give me some [ donations] . Any donation is
146+ gonna be a great motivation for me.
147+
138148## License
139149Electron React TypeScript Webpack Boilerplate is open source software
140150[ licensed as MIT] ( LICENSE ) .
151+
152+ [ notarization requirements ] : https://developer.apple.com/news/?id=04102019a
153+ [ electron-builder #3870 ] : https://github.com/electron-userland/electron-builder/issues/3870
154+ [ `[email protected] ` ] :
https://github.com/electron-userland/electron-builder/releases/tag/v22.10.4 155+ [ donations ] : https://github.com/sponsors/iamWing
0 commit comments