Skip to content

Commit

Permalink
Change the default start_url to . (facebook#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
foochu authored and Timer committed Jan 15, 2018
1 parent 4a0a115 commit 0abc43f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2002,15 +2002,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 @@ -2024,8 +2016,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 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 0abc43f

Please sign in to comment.