You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to gauge interest / comments for an easier way to customize index.html output.
Use-case
We have some dynamic values that we want to interpolate into the index.html file at build time. For example, static classes on the <html> element and special meta attributes.
Ember already provides the content-for hook, but adding individual attributes to specific html elements is trickier.
Possible solution
Exposing the internal configReplacePatterns API, for example a addReplacePattern method or a key under config (environment.js), say additionalReplacePatterns: [ … ]
Allowing custom 'slots' for use with {{content-for 'my-slot'}}.
It doesn't meet your needs here, but for discussion sake what we do is use ember-cli-deploy-json-config to extract our index.html into JSON and then parse that json on the server to send a final index.html with these dynamic parts added there.
We also have a hack in place to make this work. But it would be cleaner if something like this was available in core. Customizing index.html is pretty common.
Activity
jrjohnson commentedon Aug 18, 2022
It doesn't meet your needs here, but for discussion sake what we do is use ember-cli-deploy-json-config to extract our index.html into JSON and then parse that json on the server to send a final
index.htmlwith these dynamic parts added there.sandstrom commentedon Aug 19, 2022
Thanks, good suggestions!
We also have a hack in place to make this work. But it would be cleaner if something like this was available in core. Customizing index.html is pretty common.
bertdeblock commentedon Feb 5, 2023
I assume, under Embroider (if it's possible / allowed at some point), that using https://github.com/jantimon/html-webpack-plugin might be an option to customise the final
index.html?