Use <base> and config webpack at runtime to allow path prefix #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #42.
Allows a path prefix to be used through four changes:
package.json#homepage
is set to"."
. When create-react-app generates the build index.html the static assets are linked via relative paths.<base>
element to the index.html template. All relative paths (e.g. the static assets referenced in HTML) are relative to the value of<base>
, which is set to"/"
in index.html, but the query-service can replace it (see Provide a means to define a path-prefix for the UI jaeger#745). It's worth noting, this only affects relative paths.publicPath
value in webpack is configured at runtime via the__webpack_public_path__
global. The value is derived from the<base>
, and ensures any chunks or other assets (like the logo) are loaded relative to the site prefix.pathPrefix
used forfetch()
calls is based on the<base>
value instead ofpackage.json#homepage
As a side note, this PR can be merged before any work is done in the query-service.