47 |
48 | )
49 |
50 | export default BasicApp;
51 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # create-react-app-now
2 |
3 | Deploy React.js Static Web Apps generated with [facebook/create-react-app](https://github.com/facebook/create-react-app) to Zeit's awesome [Now.sh](https://zeit.co/now/) service.
4 |
5 | I wrote an article about this project here: [Zero Configuration Deployment for React app with Zeit Now](https://medium.com/@kawixiao/zero-configuration-deployment-for-react-apps-with-zeits-now-4f002be98c#.eyvj3mjdb)
6 |
7 | # Important
8 |
9 | UPDATE: create-react-app now officially recommend using "serve" to deploy your create-react-app project. The documentation can be found here: https://create-react-app.dev/docs/deployment
10 |
11 | I personally and strongly recommend you to check out [Next.js](https://zeit.co/blog/next) by Zeit team.
12 | That will be my personal go to choice as well when creating new React project, and deploy to now seamlessly.
13 |
14 | Though create-react-app-now can serves as an example on how you can use create-react-app and zeit's now together.
15 |
16 | Having said that, it is likely that I will not actively maintain this repo anymore (e.g. update the dependencies). I will still accept PR though.
17 |
18 | # Why
19 |
20 | create-react-app-now is created using [facebook/create-react-app](https://github.com/facebook/create-react-app).
21 | Although it supports deployment to github pages and heroku, it does not feel intuitive just yet, as we need to run lots of commands.
22 |
23 | This project is specifically to solve just that, with just 1 command: `npm run deploy`
24 |
25 | This is achieved by using Zeit's awesome [Now.sh](https://zeit.co/now/) service.
26 | It is fast, easy, and intuitive way of deploying your React app.
27 |
28 | # How
29 |
30 | Simply follow this step from getting started to deployment:
31 |
32 | ```
33 | $ npm install -g now
34 | $ git clone https://github.com/xkawi/create-react-app-now
35 | $ npm install
36 | $ npm run deploy
37 | ```
38 |
39 | First command installs the `now` cli globally as npm package. Another (or suggested) approach is to install [Now Desktop](https://zeit.co/desktop) to ensure automatic updates of `now` cli.
40 |
41 | Subsequent commands simply clone this repo, install necessary npm packages and deploy it to Now.
42 |
43 | Whenever you want to deploy new changes, just run `npm run deploy` again to get new public link, for free! :smile:
44 |
45 | You will enjoy all the benefits that Now offers out-of-the-box: real-time and immutable deployments all within 1 command.
46 |
47 | ## Note
48 |
49 | You might see some red text appears or warnings in the log. You can safely ignore this, because your project will still be deployed successfully.
50 |
51 | # Alternatives Deployment
52 |
53 | If you prefer something else, please refer to create-react-app documentation [here](https://create-react-app.dev/docs/deployment#other-solutions).
54 |
55 | # More
56 |
57 | Read more about create-react-app [here](https://github.com/facebook/create-react-app)
58 |
59 | Read more about Zeit's Now.sh [here](https://zeit.co/now)
60 |
--------------------------------------------------------------------------------