Adding a script tag to index.html to avoid stale js bundle and integrate with import-meta-env tooling
Last updated: Feb 7, 2023
Is there a way to append a script tag to the index.html?I tried writing my own little vite plugin to transform the html , but it doesn't seem to be running? I would like to add a piece of code directly to the index.html, so I don't risk having it get stale with the js bundle.
Perhaps there is a better way to do that, but I also didn't have luck with adding a script to the
dir either. My goal is to integrate with import-meta-env tooling to allow for runtime env vars while self hosting.
Feb 2, 2023, 1:39 AM
In case anyone deals with this in the future, i ended up writing a custom rollup plugin that wrote the script to the head of the