Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exclude entire import.meta.env object from content script output #1267

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

aklinker1
Copy link
Collaborator

@aklinker1 aklinker1 commented Dec 10, 2024

As mentioned on discord, content script output unnecessarily includes the entire import.meta.env object, including values from your .env file (only ones prefixed with VITE_ or WXT_, which are already included elsewhere in your extension):

Screenshot 2024-12-10 at 4 58 13 PM

This PR fixes this. Basically, this happens when you reference import.meta.env instead of import.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 replace import.meta.env.XYZ with the environment variable value instead.

Copy link

netlify bot commented Dec 10, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 2fb1e8e
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/6758c899ef1de60008f9acc7
😎 Deploy Preview https://deploy-preview-1267--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Dec 10, 2024

Open in Stackblitz

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@1267

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@1267

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@1267

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@1267

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@1267

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@1267

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@1267

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@1267

wxt

npm i https://pkg.pr.new/wxt@1267

commit: 2fb1e8e

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.21%. Comparing base (64a42de) to head (2fb1e8e).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1267      +/-   ##
==========================================
- Coverage   81.53%   81.21%   -0.32%     
==========================================
  Files         128      128              
  Lines        6286     6286              
  Branches     1071     1066       -5     
==========================================
- Hits         5125     5105      -20     
- Misses       1146     1166      +20     
  Partials       15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aklinker1 aklinker1 marked this pull request as ready for review December 10, 2024 23:02
@aklinker1 aklinker1 merged commit 72e6ca5 into main Dec 10, 2024
16 checks passed
@aklinker1 aklinker1 deleted the clean-env branch December 10, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant