Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. in terminal:
  2. 1. npm run build
  3. 2. npx serve -s build
  4. 3. now --name stocked-client ./build
  5.  
  6. 4. create now.json file and place into ./build folder.
  7. 5. In now.json file insert following:
  8. {
  9. "version": 2,
  10. "name": "bookmarks-app",
  11. "routes": [
  12. {
  13. "src": "^/static/(.*)",
  14. "dest": "/static/$1"
  15. },
  16. {
  17. "src": ".*",
  18. "dest": "/index.html"
  19. }
  20. ]
  21. }
  22.  
  23. Back to terminal:
  24. 6. now ./build
  25.  
  26. Create alias:
  27. 7. Place in now.json file "alias" :
  28. {
  29. "version": 2,
  30. + "alias": "jclk86-bookmarks-app"
  31. "name": "bookmarks-app",
  32. "routes": [
  33. {
  34. "src": "^/static/(.*)",
  35. "dest": "/static/$1"
  36. },
  37. {
  38. "src": ".*",
  39. "dest": "/index.html"
  40. }
  41. ]
  42. }
  43. Back to terminal:
  44. 8. npm run build
  45. 9. now --prod ./build
  46.  
  47. 10. add prebuild to scripts in package.json
  48. "prebuild": "CI=true react-scripts test --colors",
  49.  
  50. 11 add the following to package.json scripts:
  51. "predeploy": "npm run build",
  52. "deploy": "now --prod ./build"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement