File tree 5 files changed +61
-0
lines changed 5 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ // install babel hooks in the main process
2
+ require ( 'babel/register' ) ;
3
+
4
+ require ( './main.js' ) ;
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < title > electron es6 react boilerplate</ title >
5
+ </ head >
6
+
7
+ < body >
8
+ </ body >
9
+
10
+ < script >
11
+ // install babel hooks in the renderer process
12
+ require ( 'babel/register' ) ;
13
+
14
+ var React = require ( 'react' ) ;
15
+ var Main = require ( './views/main.jsx' ) ;
16
+
17
+ React . render ( React . createElement ( Main , null ) , document . body ) ;
18
+ </ script >
19
+ </ html >
Original file line number Diff line number Diff line change
1
+ 'use babel' ;
2
+
3
+ import app from 'app' ;
4
+ import BrowserWindow from 'browser-window' ;
5
+
6
+ let mainWindow = null ;
7
+
8
+ app . on ( 'window-all-closed' , ( ) => {
9
+ if ( process . platform != 'darwin' ) {
10
+ app . quit ( ) ;
11
+ }
12
+ } ) ;
13
+
14
+ app . on ( 'ready' , ( ) => {
15
+ mainWindow = new BrowserWindow ( { width : 800 , height : 600 } ) ;
16
+ mainWindow . loadUrl ( 'file://' + __dirname + '/index.html' ) ;
17
+ mainWindow . on ( 'closed' , ( ) => {
18
+ mainWindow = null ;
19
+ } ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " electron-es6-react" ,
3
+ "version" : " 0.1.0" ,
4
+ "main" : " bootstrapper.js" ,
5
+ "dependencies" : {
6
+ "babel" : " *" ,
7
+ "react" : " *"
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ 'use babel' ;
2
+
3
+ import React from 'react' ;
4
+
5
+ export default class Main extends React . Component {
6
+ render ( ) {
7
+ return < div > Hello from React with ES6 :)</ div > ;
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments