mizanxali / uno-online

Two player online game of UNO. Made using React and Socket.IO
https://www.youtube.com/watch?v=FBAJdbpFnjs
MIT License
140 stars 88 forks source link

What does the --prefix flag do? #4

Open praveenscience opened 3 years ago

praveenscience commented 3 years ago

Hi there,

Awesome game, thank you! Been spending a lot of time here.

This is not an issue per say, but I am just curious, in your package.json file, what does the --prefix do? Is it for heroku or?

    "client": "npm start --prefix client",
    //                   ^^^^^^^^
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
    //                                                           ^^^^^^^^                         ^^^^^^^^

Thanks in advance.

mizanxali commented 3 years ago

Hey, glad you liked the game! Okay so what the --prefix client does is, it runs the command inside of the client folder. So you can run the script at the root of the project and it will execute the command associated with that script inside the client folder.

So npm start --prefix client is the same as cd client npm start

Hope that cleared things out!