File tree Expand file tree Collapse file tree 7 files changed +21
-14
lines changed Expand file tree Collapse file tree 7 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 22![ ] ( ./.github/project-logo-400.jpg )
33
44
5- #### Template project for desktop apps using:
5+ #### Slim template for desktop apps using:
66- [ Electron] ( https://electronjs.org/ )
77- [ Typescript] ( https://www.typescriptlang.org/ )
88- [ React] ( https://reactjs.org/ )
1414<br >
1515
1616# Before anything
17- As always, install packages:
17+ As always, install packages.
18+ Open a terminal in the project root folder and run:
1819``` cmd
1920$ npm install
2021```
2122
2223
2324# During development
2425
26+ ### Start the app in ** development** mode (** with** hot reload).
2527Run:
2628``` cmd
2729$ npm start
2830```
2931It will launch webpack dev server and electron [ concurrently] ( https://www.npmjs.com/package/concurrently ) .
3032It has [ fast refresh] ( https://www.npmjs.com/package/react-refresh-webpack-plugin ) (AKA hot-reload) enabled by default.
33+ <br />
34+ <br />
35+ <br />
36+ ### Start app in ** production** mode (** without** hot reload).
37+ Run:
38+ ``` cmd
39+ $ npm run start:prod
40+ ```
3141
3242# Testing
3343Run:
@@ -41,5 +51,5 @@ Just run:
4151``` cmd
4252$ npm run pack
4353```
44- and the output will be in the ``` ./pack ``` folder.
54+ and the output will available in the ``` ./pack ``` folder.
4555
Original file line number Diff line number Diff line change @@ -38,14 +38,12 @@ app.whenReady()
3838 initialize ( ) ;
3939
4040 win . maximize ( ) ;
41- enable ( win ?. webContents ) ;
42-
41+ enable ( win . webContents ) ;
4342
4443 win . on ( "closed" , ( ) => {
4544 win = null ;
4645 } ) ;
4746
48-
4947 app . on ( 'window-all-closed' , ( ) => {
5048 if ( process . platform != "darwin" ) {
5149 app . quit ( )
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ export const GlobalStyle = createGlobalStyle`
99 margin: 0 !important;
1010 padding: 0 !important;
1111 font-family: Roboto;
12- font-weight: 600;
1312 }
1413
1514 a {
Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ export function ExampleView1() {
1818 return (
1919 < div >
2020 < h1 > Example view 1</ h1 >
21+ < h3 > Just a example view</ h3 >
22+ < p > An image:</ p >
2123 < img src = { clock } />
22- < p > { theNumber } </ p >
24+ < p > A counter:</ p >
25+ < p > < strong > { theNumber } </ strong > </ p >
2326 </ div >
2427 ) ;
2528
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ export function ExampleView2() {
2626 return (
2727 < div >
2828 < h1 > Example view 2</ h1 >
29- < p > Try to open a file</ p >
29+ < h3 > Another example view.</ h3 >
30+ < p > Try to open a file to test electron dialog and file system:</ p >
3031 < button onClick = { handleOpenFileClick } > Open file...</ button >
3132 {
3233 text &&
Original file line number Diff line number Diff line change 1- put scripts used by both renderer and main process here.
1+ put scripts and modules used by both renderer and main process here.
22import then like: import {something} from "@/shared/something";
Original file line number Diff line number Diff line change @@ -120,10 +120,6 @@ function RendererConfiguration(env: Env): Configuration {
120120 electronRenderer : true
121121 } ,
122122
123- mode : env . development ? "development" : "production" ,
124-
125- devtool : env . development ? "source-map" : undefined ,
126-
127123 entry : {
128124 "renderer-process" : "./renderer-process.tsx"
129125 } ,
You can’t perform that action at this time.
0 commit comments