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: add support for reading build time env variables from a .env file #882

Merged
merged 1 commit into from
May 4, 2022

Conversation

petebacondarwin
Copy link
Contributor

This change will automatically load up a .env file, if found, and apply its
values to the current environment. An example would be to provide a specific
CLOUDFLARE_ACCOUNT_ID value.

Related to #190

@changeset-bot
Copy link

changeset-bot bot commented May 3, 2022

🦋 Changeset detected

Latest commit: db77991

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2269865880/npm-package-wrangler-882

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/882/npm-package-wrangler-882

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2269865880/npm-package-wrangler-882 dev path/to/script.js

@petebacondarwin petebacondarwin linked an issue May 3, 2022 that may be closed by this pull request
@threepointone
Copy link
Contributor

This looks good. Open it for review so I can stamp and we'll land it?

@petebacondarwin
Copy link
Contributor Author

This looks good. Open it for review so I can stamp and we'll land it?

I think I have broken the tests on Ubuntu. So I will wait till tomorrow before marking it ready.

@threepointone
Copy link
Contributor

I cancelled the workflow, it was at 45 mins, and would eat up through our minutes haha.

@petebacondarwin petebacondarwin force-pushed the build-time-dotenv branch 3 times, most recently from 4993708 to 7d22718 Compare May 4, 2022 11:32
Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of nits, but otherwise looks good! shipit

examples/local-mode-tests/src/wrangler.dotenv.toml Outdated Show resolved Hide resolved
examples/local-mode-tests/.env Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin marked this pull request as ready for review May 4, 2022 12:43
…file

This change will automatically load up a `.env` file, if found, and apply its
values to the current environment. An example would be to provide a specific
CLOUDFLARE_ACCOUNT_ID value.

Related to cloudflare#190
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.

Support .env via miniflare
2 participants