How do I set the start_url of a manifest.json to be the root of the site?

Your start_url should be set to the following in your manifest file.

"start_url": "/"

Source: https://developers.google.com/web/fundamentals/integration/webapks


If you are running in the root of a site, for instance https://example.com/manifest.json or https://test.example.com/manifest.json you can use "start_url": "/".

However, this will also map https://example.com/test/manifest.json to https://example.com/, which fails because it's in a folder outside the scope of the manifest.

Instead, if you are using a sub-directory you need to set both a scope and the start_url:

"start_url": "./"
"scope": "."

This will cause https://example.com/test/manifest.json to map to https://example.com/test/ as expected.