Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Feature: Add user-specified conditions to ESM resolution. #56

Closed
2 tasks
ryan-roemer opened this issue May 26, 2021 · 0 comments · Fixed by FormidableLabs/tracing#12
Closed
2 tasks
Labels
feature New feature or request

Comments

@ryan-roemer
Copy link
Member

Presently we use all the common Node.js ESM conditions when resolving. But, we could take user ones too.

Task

  • Add user conditions to CONDITIONS array in trace.js
  • Consider having an override (flag or function) to remove built-in conditions.
@ryan-roemer ryan-roemer added the feature New feature or request label May 26, 2021
ryan-roemer added a commit to FormidableLabs/tracing that referenced this issue Sep 10, 2022
Adds user `conditions` flag. We're following the https://github.com/vercel/nft#exports--imports model of **always** including some built-in Node.js conditions because the Node.js runtime actually does this (e.g., if I'm running `node -C my-bespoke ./file.js` and there's an `import` condition before `my-bespoke` the Node.js built-in matching means `import` wins).

- Supersedes FormidableLabs/trace-deps#73 (Thanks so much for your work @yankovalera -- this is mostly just a retweaking of your original work here).
- Fixes FormidableLabs/trace-deps#56
- Major release: It's a very "minor Major" in that we're removing `production` and `development` user conditions by default, but practically no one has code that is likely impacted....
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant