Skip to content

Commit 0c8490e

Browse files
committed
surge deploy notes
1 parent f3bae91 commit 0c8490e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

deploy-react-surge.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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!)

0 commit comments

Comments
 (0)