surflmka.blogg.se

Npm create electron app
Npm create electron app












npm create electron app

Created by GitHub, Electron is used by a wide variety of open source and proprietary software projects, including Discord, Slack, Visual Studio Code, and many more.Įlectron is important because it made native desktop applications a lot easier due to its ability to support JavaScript, one of the world's most popular programming languages. ? " : `file:// $`Īdd -mwl for build MacOS, Windows and Linux apps.Electron is a cross-platform desktop application framework based on web technologies. Public/electron.js const electron = require( "electron") Ĭonst isDev = require( "electron-is-dev") Or yarn add -dev concurrently electron electron-builder wait-on cross-env electron-is-dev Npm install concurrently electron electron-builder wait-on cross-env electron-is-dev -save-dev wait-on for wait react application has started, then start the electron.This is for runing react-scripts and electron. concurrently for execute commands in same time.

npm create electron app

electron and electron-builder are require for electron app.In this step I will install some packages useful for electron + react development environment. Or yarn create react-app my-electron-app -template typescript npx create-react-app my-electron-app -template typescript

npm create electron app

I would like to use typescript template, but you could create without use typescript template. I create React app with commands at below.

  • Run script, should see electron app window.
  • Edit package.json scripts section, add some scripts command for run electron.
  • Add main entry to package.json for public/electron.js.
  • Add code into public/electron.js for running electron app.
  • npm create electron app

    Add public/electron.js as startup entry target.Run create-react-app to generate a basic React application.If you want to use yarn, you should install yarn before use. Create Electron + React project Prerequisite: I will create Electron + React app with yarn command, but it's comfortable to use npm command too. Build a React based Electron app Electron + React app templateīut how can we trying to start by known command line tools (create-react-app)?














    Npm create electron app