Skip to content

Commit a6ee1dd

Browse files
authored
upgrade serve and customize serve command (#2805)
1 parent 6e34169 commit a6ee1dd

File tree

3 files changed

+325
-28
lines changed

3 files changed

+325
-28
lines changed

docs/README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,27 @@ Note that paths in local development are based on a root of "/" but be careful w
1616

1717
## Want to see if you're ready to :shipit:?
1818

19-
First build the static site.
19+
First, build the static site (within /docs folder):
20+
2021
```bash
2122
yarn build
2223
```
23-
Once it builds successfully, serve it:
24+
Once the build succeeds, serve it:
2425

2526
```bash
2627
yarn serve
2728
```
28-
The staging and production sites are served from a nested path, e.g. `https://commerce.nearform.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.
29+
30+
This will render the docs site at `http://localhost:3000/open-source/victory/`. If you go to root (i.e. `http://localhost:3000/`), you will need to click through the browser's file explorer to `open-source/victory` to get to the site.
31+
32+
Note the staging and production sites are served from a nested path, e.g. `https://commerce.nearform.com/open-source/victory`. This step is important for validating that both the `basePath` used by the static HTML output and the `basename` used by the client-side router are working as expected.
2933

3034
## Deployment
3135

36+
### Preview Environments
37+
38+
Upon creating a Pull Request, a Vercel preview deployment is created and posted as a comment on the pull request to allow for testing changes.
39+
3240
### Production
3341

3442
This site is deployed with Vercel infrastructure and is automated with a repository trigger in the Formidable Labs Vercel account.

docs/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"remark-frontmatter": "^1.3.0",
6666
"remark-slug": "^5.1.1",
6767
"rimraf": "^3.0.2",
68-
"serve": "^10.0.0",
68+
"serve": "^14.2.1",
6969
"unist-util-select": "^1.5.0"
7070
},
7171
"resolutions": {
@@ -80,6 +80,7 @@
8080
"license": "MIT",
8181
"scripts": {
8282
"start": "node --max-old-space-size=2048 node_modules/react-static/bin/react-static start",
83+
"serve": "serve dist/",
8384
"build": "node ./scripts/build.js",
8485
"clean": "rimraf dist"
8586
}

0 commit comments

Comments
 (0)