File tree 8 files changed +31
-12
lines changed
8 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ module.exports = {
73
73
entryPoints : [
74
74
{
75
75
html : "./src/render/index.html" ,
76
- js : "./src/render/ renderer.ts" ,
76
+ js : "./src/renderer.ts" ,
77
77
name : "main_window" ,
78
78
preload : {
79
79
js : "./src/preload.ts" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module.exports = {
5
5
* This is the main entry point for your application, it's the first file
6
6
* that runs in the main process.
7
7
*/
8
- entry : "./src/index .ts" ,
8
+ entry : "./src/main .ts" ,
9
9
// Put your normal webpack config below here
10
10
11
11
module : {
Original file line number Diff line number Diff line change @@ -120,16 +120,16 @@ yarn create-icons
120
120
121
121
- Routes.tsx # react-router routes
122
122
123
- - renderer.ts # main electron renderer entry
124
-
125
123
- App.tsx # Export entire app with routes components
126
124
# and redux provider if you are using it
127
125
128
126
-
129
127
130
- index.ts # main electron entry
128
+ main.ts # main "backend" electron entry
129
+
130
+ renderer.ts # main "frontend" electron renderer entry
131
131
132
- preload.ts # electron preload
132
+ preload.ts # main "entry to frontend" electron preload entry
133
133
134
134
```
135
135
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ ipcMain.on("relaunch-app", () => {
22
22
} ) ;
23
23
24
24
// In this file you can include the rest of your app's specific main process
25
- // code. You can also put them in separate files and import them in index .ts.
25
+ // code. You can also put them in separate files and import them in main .ts.
Original file line number Diff line number Diff line change
1
+ /**
2
+ * This file will automatically be loaded by electron and run in the "main" context.
3
+ * This is your "backend"
4
+ * To learn more about the differences between the "main" and the "renderer" context in
5
+ * Electron, visit:
6
+ *
7
+ * https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes
8
+ */
9
+
1
10
import { app , BrowserWindow } from "electron" ;
2
11
import isDev from "electron-is-dev" ;
3
12
import Store from "electron-persist-secure/lib/store" ;
Original file line number Diff line number Diff line change 1
- import '../bridges/index' ;
1
+ /**
2
+ * This file will automatically be loaded by electron and run in the "preload-scripts" context with Node.js API access (even though its in the renderer).
3
+ * This is your "priveleged entry to frontend"
4
+ * To learn more about the differences between the "preload-scripts" and the "renderer" context in
5
+ * Electron, visit:
6
+ *
7
+ * https://www.electronjs.org/docs/tutorial/process-model#preload-scripts
8
+ */
9
+
10
+ import "../bridges/index" ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const persistConfig = {
28
28
const persistedReducer = persistReducer (
29
29
persistConfig ,
30
30
combineReducers ( {
31
- count : countReducer ,
31
+ counter : countReducer ,
32
32
char : charReducer ,
33
33
} )
34
34
) ;
Original file line number Diff line number Diff line change 1
1
/**
2
- * This file will automatically be loaded by webpack and run in the "renderer" context.
2
+ * This file will automatically be loaded by electron and run in the "renderer" context with no access to Node.js APIs (except thru the contextBridge).
3
+ * This is your "frontend"
3
4
* To learn more about the differences between the "main" and the "renderer" context in
4
5
* Electron, visit:
5
6
*
6
7
* https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes
7
8
*/
8
9
9
10
import ReactDOM from "react-dom" ;
10
- import App from "./App" ;
11
- import "./index.css" ;
11
+ import App from "./render/ App" ;
12
+ import "./render/ index.css" ;
12
13
13
14
function render ( ) {
14
15
ReactDOM . render ( App ( ) , document . getElementById ( "root" ) ) ;
You can’t perform that action at this time.
0 commit comments