John Deacon
John Deacon

Reputation: 181

When should you run the 'yarn start' command while working on a React project?

I'm having trouble finding much documentation on this command.

Say you are working on another person's React app, have unzipped it to your desktop and run 'yarn install' to get the dependencies. You are about to make some additions to the code. Is this when you run 'yarn start'?

I was given these instructions:

"Go to your terminal and navigate to the root folder of the extension. Type yarn start, this will make a build folder within the root folder. Stop that operation (on a mac it’s ctrl-c) and then build the updated version."

To me, this sounds sort of like I'm supposed to make the edits, then run 'yarn start', stop the operation and run the build command in quick succession. However, I was under the impression 'yarn start' is what you run in the beginning, before you start working on the React code.

Can someone set this straight for me? At what point in this process does 'yarn start' come into play?

Thank you!

Upvotes: 1

Views: 10125

Answers (2)

ravibagul91
ravibagul91

Reputation: 20755

As per this,

Go to your terminal and navigate to the root folder of the extension. Type yarn start, this will make a build folder within the root folder. Stop that operation (on a mac it’s ctrl-c) and then build the updated version.

it is clear that your yarn start command is building your application.

Building your application means it bundles your js, css & assets files to a single chunk file which can be run in production.

Coming back to your question, when to run yarn start.

So whenever you done with your changes and ready to go live then you call this command which will give you a updated build folder for production.

Upvotes: 4

Joseph
Joseph

Reputation: 4695

It's a predefined command in your package.json

It will look like this:

in your package.json

{
  "scripts": {
    "start": "terminal go do something"
  }
}

Upvotes: 5

Related Questions