Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default start_url to . #3346

Merged
merged 3 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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