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

feat(env): Load env from .env.[browser] variants #1078

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

sleekslush
Copy link
Contributor

Adds ability to prioritize browser-specific environment settings when resolving configuration.

The mode and browser files will have highest precedence, followed by the rest as they exist today.

.env.[mode].[browser]
.env.[mode].[browser].local

Copy link

netlify bot commented Oct 18, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 564da4a
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/6713db1bda3be0000871e8d0
😎 Deploy Preview https://deploy-preview-1078--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.

@aklinker1
Copy link
Collaborator

Nice, do you think we also need the .env.[browser] and .env.[browser].local variants?

Copy link

pkg-pr-new bot commented Oct 18, 2024

Open in Stackblitz

@wxt-dev/auto-icons

pnpm add https://pkg.pr.new/@wxt-dev/auto-icons@1078

@wxt-dev/i18n

pnpm add https://pkg.pr.new/@wxt-dev/i18n@1078

@wxt-dev/module-react

pnpm add https://pkg.pr.new/@wxt-dev/module-react@1078

@wxt-dev/module-solid

pnpm add https://pkg.pr.new/@wxt-dev/module-solid@1078

@wxt-dev/module-svelte

pnpm add https://pkg.pr.new/@wxt-dev/module-svelte@1078

@wxt-dev/module-vue

pnpm add https://pkg.pr.new/@wxt-dev/module-vue@1078

wxt

pnpm add https://pkg.pr.new/wxt@1078

commit: 564da4a

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.76%. Comparing base (1a9cd43) to head (564da4a).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1078      +/-   ##
==========================================
- Coverage   82.24%   81.76%   -0.48%     
==========================================
  Files         127      127              
  Lines        6635     6670      +35     
  Branches     1107     1108       +1     
==========================================
- Hits         5457     5454       -3     
- Misses       1164     1202      +38     
  Partials       14       14              

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

@aklinker1 aklinker1 changed the title Adds a browser override when resolving environment variables feat(env): Add support for loading .env.[browser] dotenv file variants Oct 19, 2024
@aklinker1 aklinker1 changed the title feat(env): Add support for loading .env.[browser] dotenv file variants feat(env): Add support for .env.[browser] dotenv file variants Oct 19, 2024
@aklinker1 aklinker1 changed the title feat(env): Add support for .env.[browser] dotenv file variants feat(env): Load env from .env.[browser] variants Oct 19, 2024
@sleekslush
Copy link
Contributor Author

Nice, do you think we also need the .env.[browser] and .env.[browser].local variants?

I considered about doing that but thought it might be weird if someone did --mode=chrome. I don't think it necessarily is a problem, so I could go either way.

@aklinker1
Copy link
Collaborator

I added them. I'll merge and do a release with this soon!

@aklinker1 aklinker1 merged commit c031c6e into wxt-dev:main Oct 22, 2024
18 checks passed
@aklinker1
Copy link
Collaborator

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.

2 participants