Skip to content

Commit

Permalink
Mention that start_url needs to be "." for client side routing
Browse files Browse the repository at this point in the history
* Change template manifest start_url to dot to make it react-router friendly

* Revert "Change template manifest start_url to dot to make it react-router friendly"

This reverts commit 02f53e8.

* Add a note about PWA manifest and client-side routing
  • Loading branch information
foochu authored and gaearon committed Oct 28, 2017
1 parent fc885a0 commit e05a5fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,12 @@ service worker navigation routing can be configured or disabled by
and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp)
options of the `SWPreachePlugin` [configuration](../config/webpack.config.prod.js).
When users install your app to the homescreen of their device the default configuration will make a shortcut to `/index.html`. This may not work for client-side routers which expect the app to be served from `/`. Edit the web app manifest at [`public/manifest.json`](public/manifest.json) and change `start_url` to match the required URL scheme, for example:
```js
"start_url": ".",
```
### Building for Relative Paths
By default, Create React App produces a build assuming your app is hosted at the server root.<br>
Expand Down

0 comments on commit e05a5fe

Please sign in to comment.