1
1
# Electron-React-TypeScript-Webpack-Boilerplate
2
2
Pre-configured Electron.js + React.js + TypeScript boilerplate with
3
- Webpack v4 & linters config predefined.
3
+ Webpack v5 & linters config predefined.
4
4
5
5
This 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 ) .
7
7
8
8
## Getting started
9
9
``` sh
@@ -20,7 +20,7 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
20
20
"build" : {
21
21
"appId" : your-app-id,
22
22
"productName" : your-product-name,
23
- "buildVersion" : whatever-you-like
23
+ "buildVersion" : your-build-number
24
24
},
25
25
"author" : who's-the-author?,
26
26
"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
34
34
Then install all the ` node_modules ` needed by executing the following command:
35
35
``` sh
36
36
cd folder-containing-the-cloned-boilerplate
37
- npm install
37
+ npm install --also-dev
38
38
```
39
39
40
40
Finally execute the following command to start Webpack in development mode and
@@ -55,17 +55,19 @@ your app for macOS & Windows using `electron-builder`.
55
55
56
56
For macOS, execute:
57
57
``` sh
58
+ npm run prod
58
59
npm run build:mac
59
60
```
60
61
61
62
For Windows, execute:
62
63
``` sh
64
+ npm run prod
63
65
npm run build:win
64
66
```
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. ** _
69
71
70
72
### Extra options
71
73
The 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,
93
95
please refer to [ documents of ` electron-builder ` ] ( https://www.electron.build/cli ) .
94
96
95
97
## 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.
107
114
108
115
## Folder structure
109
116
```
@@ -127,14 +134,22 @@ electron-react-typescript-base-proj/
127
134
| - package-lock.json
128
135
| - package.json
129
136
| - tsconfig.json //- TypeScript config
130
- | - tslint.json //- TSLint config
131
137
| - webpack.config.js //- Webpack config
132
138
```
133
139
134
140
## Author
135
-
136
141
[ Wing Chau] ( https://github.com/iamWing ) [ @Devtography ] ( https://github.com/Devtography )
137
142
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
+
138
148
## License
139
149
Electron React TypeScript Webpack Boilerplate is open source software
140
150
[ 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