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(defineEnv): support resolving paths #373

Merged
merged 5 commits into from
Dec 12, 2024
Merged

feat(defineEnv): support resolving paths #373

merged 5 commits into from
Dec 12, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Dec 11, 2024

This PR adds a feature to new defineEnv util (introduced in #372) to allow resolving env config with absolute resolved paths.

ESM resolves are made using mlly (using the same Node.js ESM resolution logic with CJS compat and more features)

Resolve paths can be configured to extended. by default, a resolution from unenv itself will be done as last fallback.

Pending #374 to allow external presets paths. (updates tiny change on #374 to use meta.url with ESM compat for URL)

@pi0 pi0 self-assigned this Dec 11, 2024
@pi0 pi0 requested a review from vicb December 11, 2024 18:40
This was referenced Dec 11, 2024
@pi0 pi0 marked this pull request as ready for review December 12, 2024 15:09
src/env.ts Outdated Show resolved Hide resolved
@pi0
Copy link
Member Author

pi0 commented Dec 12, 2024

One thing left, we need to add unenv/ itself to aliases (+ preset names) but delaying it to see if we need.

@pi0 pi0 merged commit af71c96 into main Dec 12, 2024
2 checks passed
@pi0 pi0 deleted the feat/env-resolve branch December 12, 2024 15:29
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