Reputation: 401
I have created a web application using react js. after finishing the development how to package it in order to run it without using an IDE and make it ready for production? In java we create a jar file and run it.how is it done in react? How to create an executable file?
Upvotes: 0
Views: 8521
Reputation: 13654
You will not be able to create an executable file from React app, unless you will use Electron
The thing which you probably think of is bundling the app into single JS and HTML files (or multiple JS files if you are using code splitting).
This can be done by Webpack or other bundlers.
Are you using create-react-app? If so, just run npm run build
inside your project folder. You will get dist
folder with all JS/HTML/assets which you just have to deploy on your server and that is it.
If you are not using create-react-app it would be probably better to use some prepared boilerplate, put your code there and use its build
script.
Upvotes: 1