Difference between revisions of "pas2js Electron Web Application"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "= Electron Web Application = Since Lazarus 2.3 and pas2js 2.2.1. =Install Electron= First you must install '''node.js'''. * Windows, MacOS: https://nodejs.org/en/download/...")
 
Line 29: Line 29:
 
Install pas2jsdgn package. For more information see [[lazarus_pas2js_integration|here]]
 
Install pas2jsdgn package. For more information see [[lazarus_pas2js_integration|here]]
  
You get a new project type '''Electron Web Application''', which is like a ''Web Browser Application'', except this wizard creates three projects, the '''preload.lpi''', the '''render.lpi''' and '''YourApp.lpi''', and a project group. After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.
+
You get a new project type '''Electron Web Application''', which is like a ''Web Browser Application'', except this wizard creates three projects, the '''preload.lpi''', the '''render.lpi''' and '''YourApp.lpi''', and a project group.  
 +
 
 +
After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.
  
 
To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.
 
To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.

Revision as of 15:51, 20 April 2022

Electron Web Application

Since Lazarus 2.3 and pas2js 2.2.1.

Install Electron

First you must install node.js.

sudo apt install nodejs npm

Check that node and npm work:

node -v
npm -v

Create some directory and install electron into to:

mkdir mynodejs
cd mynodejs
npm install --save-dev electron

This should create a sub folder node_modules containing electron:

C:\Whatever\mynodejs\node_modules\electron\dist\electron.exe

Set the full path to this executable in Lazarus Tools / Options / pas2js / Electron executable

Lazarus Electron Web Application

Install pas2jsdgn package. For more information see here

You get a new project type Electron Web Application, which is like a Web Browser Application, except this wizard creates three projects, the preload.lpi, the render.lpi and YourApp.lpi, and a project group.

After the options dialog it asks for the file name of the webapp program source filename (usually a *.lpr or *.pas). Choose some name, you can later rename it.

To run it you must compile all three projects to create the three needed js files. The project group window helps you to switch easily and compile all projects.