1

I have created two apps using 'Visual Studio Code' and 'node.js.' I run them using command 'npm start,' and they show in the browser. I want to build them or deploy them so they can be used by anyone. It says there to use command 'npm run build.' How to do that, and what technique you use in order to build them?

2 Answers 2

2

It depends on what configuration you used for building the React app. If you used create-react-app, npm run build is the correct command for building it.

If you used a different configuration (e.g. webpack), you should use the relevant command for that configuration.

Either way, deploying it will be as easy as copy/pasting the build folder's content to the server you want to host it, after running the build command.

Sign up to request clarification or add additional context in comments.

3 Comments

I ran the build command. When it comes to deploying, are you talking about Firebase or Azure?
@technopyle I tried a few including github, but the one easier to work was Surge. Is Surge all right?
It looks fine to me, yes.
0

Visual Studio Code or any other Code Editor for that matter is not relevant. You can develop, build and deploy any React app using any Code Editor you want, it's just a matter of preference.

  • "Building" refers to the task of preparing (transforming, minifying, compressing, etc.) all the relevant project files so that they're ready for production (assuming that your build scripts are configured to do so).

  • "Deploying" an app is usually a separate task that will deploy (upload) your current project build to a development platform provider like Firebase, Netlify, Azure, etc. Note that you have to register with a provider and setup a new project on their end before your deploy your project.

Which provider you use is totally up to you. Also, you have to configure your current project once you've chosen your development provider. They'll provide instructions on how to deploy your project.

On a side note, keep in mind that you can configure your own npm scripts so that they run whatever you want. More about that here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.