![]() public/ directory it will get copied to. It expects electron.js to be in the root of target directory. Unlike electron, electron-builder doesn’t look for main script in package.json, build/, which in our case will be generated by react-scripts build. Since target directory is not specified (using -dir parameter) the electron-builder Start - just runs dev server and app in parallel, and as mentioned above the app will start only after dev server has responded.īuild - builds react app and then packs it using the electron-builder. Starting up electron will go for main script from package.json. where dot is a path argument pointing to current directory. The wait-on utility waits until the given endpoint (in our case which is the react dev server default address) Start-dev-app - starts the electron app from current folder after dev server has started. We use cross-env utility here to set a BROWSER=none environment variable which is a flag for react-scripts start not to start the browser. Start-dev-server - starts a react development server. ![]() Once it’s done we should be able to start the app in development mode by running npm start, or build a desktop app using npm run build. This will create the application window for your app. ![]() When the app is ready, call the createWindow() function.Win.loadFile( 'dist/electron-app/index.html') In this file, initialize Electron so that you can use it to create the application window. Create a file in the root of your project named main.js.How to Use Electron to Open an Angular Application in a Desktop WindowĬreate the main.js file, and configure it to open the application's content inside a desktop window.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |