Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does the --prefix flag do? #4

Open
praveenscience opened this issue Mar 7, 2021 · 1 comment
Open

What does the --prefix flag do? #4

praveenscience opened this issue Mar 7, 2021 · 1 comment

Comments

@praveenscience
Copy link

praveenscience commented Mar 7, 2021

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
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants