Difference between revisions of "Electron Build"

From Lianjapedia
Jump to: navigation, search
(Files)
(Files)
Line 50: Line 50:
 
The '''debug-main.js''' file is used when you build in '''Debug''' mode.
 
The '''debug-main.js''' file is used when you build in '''Debug''' mode.
  
It includes the instruction to automatically open the developer tools (mainWindow.webContents.openDevTools()) when the App is run.
+
It includes the instruction to automatically open the developer tools when the App is run.
 +
 
 +
(mainWindow.webContents.openDevTools())  
  
 
<br clear=all>
 
<br clear=all>

Revision as of 12:36, 10 November 2017

Init

Electron Workspace



Click the Init button.

This copies the template Electron files to the electron sub-directory of your App.


Electron Workspace



When the copy is complete, the App is now ready to build with Electron message will be displayed.


Files

Electron Workspace



From the Files pulldown, select the template files you want to edit in a popup editor.


Electron Workspace



Edit the package.json file to define the configuration of your Electron App.

The template file shows the format required.

Note: the version refers to your App version.


Electron Workspace



The debug-main.js file is used when you build in Debug mode.

It includes the instruction to automatically open the developer tools when the App is run.

(mainWindow.webContents.openDevTools())


Electron Workspace



When building in Release mode, the release-main.js file is used.


Edit

Electron Workspace



Edit the Electron App Settings as required.

Specify the Lianja Cloud Server URL and any optional settings.

Then click Save to save your changes or Cancel to exit without saving.


Build

Electron Workspace



Check that the Platform, Architecture and Config pulldowns are displaying the correct values for your intended build.

Then click the Build button to build your Electron App.


Run

Electron Workspace



Once the Electron Build Log output window displays Build complete, click the Run button to run your App.


Electron Workspace



Your App will be displayed in a popup window.

Log in as usual.


Electron Workspace



And test your App.


Deploy

The files required to deploy your Electron App are created in:

<drive>:\lianja\apps\<appname>\electron\dist\<app>-<platformname>-<architecture>

For example, in the screenshots above the files are created in:

C:\lianja\apps\lianja_mobiledemo\electron\dist\lianja_mobiledemo-win32-ia32