Skip to content

Handle .env files in node output path#46

Merged
ijjk merged 2 commits intomainfrom
ijjk/env-files
Apr 1, 2026
Merged

Handle .env files in node output path#46
ijjk merged 2 commits intomainfrom
ijjk/env-files

Conversation

@ijjk
Copy link
Copy Markdown
Collaborator

@ijjk ijjk commented Mar 31, 2026

Summary

  • detect project .env / .env.* files in the node output path and include them in each node function file map
  • when .env files are detected, resolve @next/env relative to next, include its loader file in the function files, and pass the loader path into the generated node handler
  • in the handler, load env files via the injected @next/env path only when enabled
  • emit a build-time warning during detection: "Detected .env file, it is strongly recommended to use Vercel's env handling instead"

x-ref: vercel/next.js#92116

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: 3ca8f23

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

This PR includes changesets to release 1 package
Name Type
@next-community/adapter-vercel 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

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
adapter-vercel-adapter Ready Ready Preview, Comment Mar 31, 2026 4:19pm

Request Review

@ijjk ijjk merged commit 99a684d into main Apr 1, 2026
5 checks passed
@ijjk ijjk deleted the ijjk/env-files branch April 1, 2026 22:20
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