Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in terminal:
- 1. npm run build
- 2. npx serve -s build
- 3. now --name stocked-client ./build
- 4. create now.json file and place into ./build folder.
- 5. In now.json file insert following:
- {
- "version": 2,
- "name": "bookmarks-app",
- "routes": [
- {
- "src": "^/static/(.*)",
- "dest": "/static/$1"
- },
- {
- "src": ".*",
- "dest": "/index.html"
- }
- ]
- }
- Back to terminal:
- 6. now ./build
- Create alias:
- 7. Place in now.json file "alias" :
- {
- "version": 2,
- + "alias": "jclk86-bookmarks-app"
- "name": "bookmarks-app",
- "routes": [
- {
- "src": "^/static/(.*)",
- "dest": "/static/$1"
- },
- {
- "src": ".*",
- "dest": "/index.html"
- }
- ]
- }
- Back to terminal:
- 8. npm run build
- 9. now --prod ./build
- 10. add prebuild to scripts in package.json
- "prebuild": "CI=true react-scripts test --colors",
- 11 add the following to package.json scripts:
- "predeploy": "npm run build",
- "deploy": "now --prod ./build"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement