-
Notifications
You must be signed in to change notification settings - Fork 293
Deploy
You just need to npm run build
.
It'll transpile the src
code into the dist
folder together with the files from the public
folder. Those are all static files, so you can serve them from any CDN.
dist
├── 405aaeeb621471c41441dbbf8bfebafb.svg
├── app.f18f97c7aa4bf5ecf566.js
├── icon.png
├── index.html
├── thumbnail.png
└── vendor.781a0a9544de9fca1ce8.js
Running npm run build
on the redux-ssr
branch will transpile both client and server code into the dist
folder. It'll look like this:
dist
├── public
│ ├── 405aaeeb621471c41441dbbf8bfebafb.svg
│ ├── app.d23c8888dbea41aec884.js
│ ├── icon.png
│ ├── thumbnail.png
│ └── vendor.27cc3fbd60bd8ea8d0f6.js
├── assets.json
└── server.js
Unlike master
and redux
branches, you'll need to deploy the entire project.
Example on Heroku using Heroku CLI:
# start a new local git repository if you haven't done yet
git init
# create a new heroku app
heroku apps:create my-new-app
# add heroku remote reference to the local repository
heroku git:remote --app my-new-app
# commit and push the files
git add -A
git commit -m "Initial commit"
git push heroku master
# open the deployed app in the browser
heroku open
The second time you deploy, you just need to:
git add -A
git commit -m "Update code"
git push heroku master
There're cases when you will want to build the app to run on non-root URL paths, such as https://username.github.io/foo. Just pass a PUBLIC_PATH
environment variable when building:
$ PUBLIC_PATH=foo npm run build
$ npm run build:example
Special thanks to @kybarg and @protoEvangelion for helping to write this Wiki. Please, feel free to edit/create pages if you think it might be useful (also, see #33)