Files
backstage/.changeset/purple-grapes-kick.md
T
Patrik Oldsberg 5fdc8df0e8 cli: make config available in index.html template
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-12-19 15:11:13 +01:00

983 B

@backstage/cli
@backstage/cli
patch

The frontend configuration is now available as a config global during templating of the index.html file. This allows for much more flexibility as the values available during templating is not longer hardcoded to a fixed set of values.

For example, to access the app title, you would now do the following:

<title><%= config.getString('app.title') %></title>

Along with this change, usage of the existing app.<key> values has been deprecated and will be removed in a future release. The general pattern for migrating existing usage is to replace <%= app.<key> %> with <%= config.getString('app.<key>') %>, although in some cases you may need to use for example config.has('app.<key>') or config.getOptionalString('app.<key>') instead.

The @backstage/create-app changelog also contains more details how to migrate existing usage.