You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+30-10
Original file line number
Diff line number
Diff line change
@@ -27,17 +27,12 @@ npm start
27
27
28
28
## Structure of the project
29
29
30
-
The application is split between two main folders...
30
+
The sources is located in the `src` folder. Everything in this folder will be built automatically when running the app with `npm start`.
31
31
32
-
`src` - this folder is intended for files which need to be transpiled or compiled (files which can't be used directly by Electron).
33
-
34
-
`app` - contains all static assets (put here images, css, html etc.) which don't need any pre-processing.
32
+
Stylesheets are written in `less` and are located in `src/stylesheets`. They will be build into a single `main.css` in the `app` folder.
35
33
36
34
The build process compiles all stuff from the `src` folder and puts it into the `app` folder, so after the build has finished, your `app` folder contains the full, runnable application.
37
35
38
-
Treat `src` and `app` folders like two halves of one bigger thing.
39
-
40
-
41
36
## The build pipeline
42
37
43
38
Build process is founded upon [gulp](https://github.com/gulpjs/gulp) task runner and [rollup](https://github.com/rollup/rollup) bundler. There are two entry files for your code: `src/background.js` and `src/app.js`. Rollup will follow all `import` statements starting from those files and compile code of the whole dependency tree into one `.js` file for each entry point.
@@ -51,17 +46,42 @@ Side note: If the module you want to use in your app is a native one (not pure J
51
46
52
47
## Working with modules
53
48
54
-
Thanks to [rollup](https://github.com/rollup/rollup) you can (and should) use ES6 modules for all code in `src` folder. But because ES6 modules still aren't natively supported you can't use them in the `app` folder.
49
+
Thanks to [rollup](https://github.com/rollup/rollup) you can (and should) use ES6 modules for most code in `src` folder.
55
50
56
51
Use ES6 syntax in the `src` folder like this:
57
52
```js
58
53
importmyStufffrom'./my_lib/my_stuff';
59
54
```
60
55
61
-
But use CommonJS syntax in `app` folder. So the code from above should look as follows:
56
+
The exception is in `src/public`. ES6 will work inside this folder, but it is limited to what Electron/Chromium supports. The key thing to note is that you cannot use `import` and `export` statements. Imports and exports need to be done using CommonJS syntax:
57
+
62
58
```js
63
-
var myStuff =require('./my_lib/my_stuff');
59
+
constmyStuff=require('./my_lib/my_stuff');
60
+
const { myFunction } =require('./App');
61
+
```
62
+
63
+
## Issues with Install
64
+
65
+
### node-gyp
66
+
Follow the installation instruction on [node-gyp readme](https://github.com/nodejs/node-gyp#installation).
67
+
68
+
#### Ubuntu Install
69
+
You will need to install:
70
+
```sh
71
+
build-essential
72
+
libevas-dev
73
+
libxss-dev
64
74
```
75
+
### Fedora Install
76
+
You will need to install:
77
+
```sh
78
+
libX11
79
+
libXScrnSaver-devel
80
+
gcc-c++
81
+
```
82
+
83
+
#### Windows 7
84
+
On Windows 7 you may have to follow option 2 of the [node-gyp install guide](https://github.com/nodejs/node-gyp#installation) and install Visual Studio
0 commit comments