File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ # Deploying a React app with Surge (from Create React App format)
2+
3+ ** 1. Make sure you have surge installed globally**
4+
5+ - ` npm install -g surge `
6+
7+ ** 2. Run the Create React App build**
8+
9+ - ` cd your-react-project `
10+ - ` npm run build `
11+
12+ ** 3. Change into build directory**
13+
14+ - ` cd build `
15+
16+ ** 4. Run surge**
17+
18+ - ` surge `
19+ - Log in with your email and password, hit enter
20+ - Enter the correct path to your project, hit enter
21+ - Change the url to your custom url or use the default, hit enter
22+ - Surge will run deploy
23+
24+ ### Adding deploy script to package.json
25+
26+ - In package.json under "scripts" add this line:
27+ - ` "deploy": "npm run build && surge ./build/ your-surge-url.surge.sh" `
28+ - Update ` your-surge-url ` with your url
29+ - ` npm run deploy ` (this will need to be run from your project root, not the build directory!)
You can’t perform that action at this time.
0 commit comments