Skip to content

Commit

Permalink
Change the default start_url to . (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
foochu authored and gaearon committed Jan 14, 2018
1 parent b6286b3 commit 0dbf119
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1999,15 +1999,7 @@ If you’re using [Apache Tomcat](http://tomcat.apache.org/), you need to follow
Now requests to `/todos/42` will be handled correctly both in development and in production.
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": ".",
```
When users install your app to the homescreen of their device the default configuration will make a shortcut to `/`. This may not work if you don't use a client-side router and expect the app to be served from `/index.html`. In this case, the web app manifest at [`public/manifest.json`](public/manifest.json) and change `start_url` to `./index.html`.
### Service Worker Considerations
Expand All @@ -2021,8 +2013,7 @@ and work without requiring a network connection.
If you are using the `pushState` history API and would like to enable service
worker support for navigations to URLs like `/todos/42`, you need to
[`npm eject`](#npm-run-eject) and enable the
[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
[`npm eject`](#npm-run-eject) and enable the [`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp)
options of the `SWPreachePlugin` [configuration](../config/webpack.config.prod.js).
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/template/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
Expand Down

0 comments on commit 0dbf119

Please sign in to comment.