question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom templating in index.html

See original GitHub issue

Feature Suggestion

Allow for custom templating in the index.html that is served by the app plugin.

Possible Implementation

We could pass the rest of app config because extraneous fields are not removed.

Context

I would like to be able to modify the index.html by conditionally adding certain script tags. Unfortunately, because of the limited variables passed to the HtmlWebpackPlugin, I am unable to do so.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Rugvipcommented, Aug 18, 2021

A possible way forward here is to power up the app-backend plugin a bit and let it template the index file. That’s be the most straightforward place and perhaps least hacky as well. It really wouldn’t need any file rewrites or anything either, just a custom handler.

Other options if you want to do this in the deployment end are scripts similar to https://github.com/backstage/backstage/blob/557faeb7e1d1480ae6618ee4068079fec98fb85f/contrib/docker/frontend-with-nginx/docker/inject-config.sh#L5 or perhaps some other flavors of dynamic web servers.

0reactions
github-actions[bot]commented, Dec 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Customize an HTML Template - Web Design TutsPlus
It's now time to open up your HTML file for editing. Open the “index.html” file in Sublime Text and you should see something...
Read more >
HTML Starter Template – A Basic HTML5 Boilerplate for index ...
This element is the doctype declaration of the HTML file. <!DOCTYPE html> tells the browser to render the HTML codes as HTML5 (as...
Read more >
How to Customize an HTML Template | by Hillaryfiverr | Medium
Sometimes you decide to buy an HTML template and customize it by yourself. But when it comes to editing the code, you feel...
Read more >
The Content Template element - HTML - MDN Web Docs
The HTML element is a mechanism for holding HTML that is not to be rendered immediately when a page is loaded but may...
Read more >
Custom HTML Template | Poi
Custom HTML Template. When you're using JavaScript entrypoints, index.html will be generated from a HTML template file, this is the default ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found