[Feature]: Define default replace values
In the InjectHTMLConfig we have the replace field. This field currently only allows for undefined fields
It would be awesome if we could define more than just this field.
As an example:
plugins: [injectHTML({
replace: {
undefined: "",
version: "1.0.0"
}
})]
This would now mean that if we have {=$version} somewhere and it is not defined we replace it with the default value.
Perhaps it would be better to get that solved via ENV replacements (see #15)?
I have never worked with vite ENV vars so I have no Idea how you define them. But if its as easy as: ENV VAR -> Replace then yeah that would totally do it!
How would the replacement actually work then, like how would I define "replace this"?
As an example:
If I have the env var version
Would it replace ={$version} or would I do <load src="..." version="%version%" />