Create-react-app: Build production on create-react-app ?

Created on 13 Aug 2016  路  8Comments  路  Source: facebook/create-react-app

hello all,
i have answer.
how to build create-app-react on production ?
tks for see.

Most helpful comment

I believe the tool should print instructions right after build, does it not?

For example:

npm install -g pushstate-server
pushstate-server build

And then you can open localhost:9000 to see the production version. Those files in the build folder are ready to be deployed.

If you need to deploy to a non-root location (like GH Pages) you will need to specify homepage in package.json before building.

All 8 comments

Did you even read the README.md?

https://github.com/facebookincubator/create-react-app#npm-run-build

i was read, npm run build compeleted , how to run folder build ? tks for answer.

You have to upload the build folder to your web server, or deploy it to one of the services we have guides for: https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#deployment

I believe the tool should print instructions right after build, does it not?

For example:

npm install -g pushstate-server
pushstate-server build

And then you can open localhost:9000 to see the production version. Those files in the build folder are ready to be deployed.

If you need to deploy to a non-root location (like GH Pages) you will need to specify homepage in package.json before building.

tks for all. i do it.

@gaearon that confuse me, my cra cli is telling me to install serve not pushstate-server, why would you want to install a different ?

What's the difference between the recommended by facebook serve and the recommended one @gaearon pushstate-server ?

I believe pushstate-server was the previously recommended solution. We now recommend serve instead so you should use that.

This issue is almost 2 years old which is why the information is out of date. Please avoid commenting in old, closed issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

wereHamster picture wereHamster  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

fson picture fson  路  3Comments

jnachtigall picture jnachtigall  路  3Comments