Skip to content

Commit 09512a3

Browse files
foochuTimer
authored andcommitted
Change the default start_url to . (facebook#3346)
1 parent 78835ab commit 09512a3

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

packages/react-scripts/template/README.md

+2-11
Original file line numberDiff line numberDiff line change
@@ -1999,15 +1999,7 @@ If you’re using [Apache Tomcat](http://tomcat.apache.org/), you need to follow
19991999
20002000
Now requests to `/todos/42` will be handled correctly both in development and in production.
20012001
2002-
When users install your app to the homescreen of their device the default
2003-
configuration will make a shortcut to `/index.html`. This may not work for
2004-
client-side routers which expect the app to be served from `/`. Edit the web app
2005-
manifest at [`public/manifest.json`](public/manifest.json) and change
2006-
`start_url` to match the required URL scheme, for example:
2007-
2008-
```js
2009-
"start_url": ".",
2010-
```
2002+
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`.
20112003
20122004
### Service Worker Considerations
20132005
@@ -2021,8 +2013,7 @@ and work without requiring a network connection.
20212013
20222014
If you are using the `pushState` history API and would like to enable service
20232015
worker support for navigations to URLs like `/todos/42`, you need to
2024-
[`npm eject`](#npm-run-eject) and enable the
2025-
[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
2016+
[`npm eject`](#npm-run-eject) and enable the [`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
20262017
and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp)
20272018
options of the `SWPreachePlugin` [configuration](../config/webpack.config.prod.js).
20282019

packages/react-scripts/template/public/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"type": "image/x-icon"
99
}
1010
],
11-
"start_url": "./index.html",
11+
"start_url": ".",
1212
"display": "standalone",
1313
"theme_color": "#000000",
1414
"background_color": "#ffffff"

0 commit comments

Comments
 (0)