-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create deploy-gatsby.md * Made suggested improvements * Update deploy-gatsby.md * Changed React to uppercase. * Rename deploy-gatsby.md to docs/deploy-gatsby.md * Rename docs/deploy-gatsby.md to docs/docs/deploy-gatsby.md * adding deploy gatsby * Update deploy-gatsby.md remove additional render
- Loading branch information
1 parent
96b6d84
commit c7409fc
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Deploying Gatsby | ||
|
||
## Best Practice | ||
|
||
|
||
Though you can deploy from the same location multiple times it is recommended that you clear your public directory of any `.html` files before each build | ||
e.g. using surge | ||
|
||
```bash | ||
rm -rf public/*.html && gatsby build && surge public/ | ||
``` | ||
|
||
because this is going to be executed on every deploy it is suggested that you use a `package.json` script to simplify this process | ||
|
||
## Providers | ||
|
||
[Surge.sh](http://surge.sh/) | ||
|
||
[Forge](https://getforge.com/) | ||
|
||
[Netlify](https://www.netlify.com/) | ||
|
||
[GitHub-Pages](https://pages.github.com/) | ||
|
||
## Debugging | ||
|
||
`Unable to find element with ID ##` | ||
or alternatively | ||
`Uncaught Error: Minified React error #32; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=32&args[]=## for the full message or use the non-minified dev environment for full errors and additional helpful warnings.` | ||
|
||
This is a new problem when dealing with static sites built with React. React uses HTML comments to help identify locations of components that do not render anything. If you are using a CDN that minifies your HTML, it will eliminate the HTML comments used by react to take control of the page on the client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters