Skip to content

Commit cc07a34

Browse files
foochuakstuhl
authored andcommitted
Change the default start_url to . (facebook#3346)
1 parent 9c061e7 commit cc07a34

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
@@ -2002,15 +2002,7 @@ If you’re using [Apache Tomcat](http://tomcat.apache.org/), you need to follow
20022002
20032003
Now requests to `/todos/42` will be handled correctly both in development and in production.
20042004
2005-
When users install your app to the homescreen of their device the default
2006-
configuration will make a shortcut to `/index.html`. This may not work for
2007-
client-side routers which expect the app to be served from `/`. Edit the web app
2008-
manifest at [`public/manifest.json`](public/manifest.json) and change
2009-
`start_url` to match the required URL scheme, for example:
2010-
2011-
```js
2012-
"start_url": ".",
2013-
```
2005+
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`.
20142006
20152007
### Service Worker Considerations
20162008
@@ -2024,8 +2016,7 @@ and work without requiring a network connection.
20242016
20252017
If you are using the `pushState` history API and would like to enable service
20262018
worker support for navigations to URLs like `/todos/42`, you need to
2027-
[`npm eject`](#npm-run-eject) and enable the
2028-
[`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
2019+
[`npm eject`](#npm-run-eject) and enable the [`navigateFallback`](https://github.com/GoogleChrome/sw-precache#navigatefallback-string)
20292020
and [`navigateFallbackWhitelist`](https://github.com/GoogleChrome/sw-precache#navigatefallbackwhitelist-arrayregexp)
20302021
options of the `SWPreachePlugin` [configuration](../config/webpack.config.prod.js).
20312022

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)