fix: Exclude entire import.meta.env
object from content script output
#1267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As mentioned on discord, content script output unnecessarily includes the entire
import.meta.env
object, including values from your .env file (only ones prefixed withVITE_
orWXT_
, which are already included elsewhere in your extension):This PR fixes this. Basically, this happens when you reference
import.meta.env
instead ofimport.meta.env.VAR_NAME
.We were doing this because of the old Jiti import method, which used CJS, and thus
import.meta.env
was undefined. Fixed this by telling Jiti to replaceimport.meta.env.XYZ
with the environment variable value instead.