Accept an explicit tsconfig path through the API, not only `TS_NODE_PROJECT` / `OXC_TSCONFIG_PATH`
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #817 by @Brooooooklyn — merged
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start with src/lib.rs around init_resolver (lines 1515–1516), then trace how the resolver and tsconfig source are initialized and exposed through the API. Compare the constructor and createResolve/load entry points named in the proposal; choose an API that passes the path without changing process.env while preserving environment-variable behavior. Done means callers can select a tsconfig through the API and existing environment-based selection still works.
Written by the indexing model from the issue text.
Description
An explicit tsconfig can only be selected through environment variables: init_resolver reads TS_NODE_PROJECT, then OXC_TSCONFIG_PATH (src/lib.rs#L1515-L1516).
That is awkward for a tool that wraps the loader and lets its user pick a tsconfig. Vite+ runs scripts with vpx --tsconfig <path> script.ts:
- Setting
OXC_TSCONFIG_PATHfor the loader also sets it for the user's script and for every process the script spawns. A nestedoxnode, or another loader, then inherits a tsconfig chosen for the outer script. - A
TS_NODE_PROJECTthat the user exported for ts-node takes precedence overOXC_TSCONFIG_PATH, so the wrapper would have to remove it from the environment, which changes what the user's own child processes see.
Proposal
Accept the path through the API, so a loader can pass it without touching process.env. For example:
- an option on the
OxcTransformerconstructor and oncreateResolve/load(e.g.{ tsconfig?: string }); or - a function such as
setTsconfigPath(path)that must run before the first transform or resolve, since the resolver and tsconfig source live in a process-wideOnceLock.
The environment variables would keep working as they do now.
Today Vite+ patches the variable name to its own VP_SCRIPT_TSCONFIG.
- Dominant language
- TypeScript
- Stars
- 252
- Forks
- 10
- Avg merge
- 9h 46m
- Merged PRs (30d)
- 74
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oxc-project/oxc-node
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
oxc-project/oxc-node#891 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
oxc-project/oxc-node#449 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
oxc-project/oxc-node#329 ·
Maintainers usually reply within 1 day
All issues in oxc-project/oxc-node
Similar issues
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
devdotfast/whiteboard#1415 · 1 comment ·
Maintainers usually reply within 1 day
-
area/sessions comp/desktop desktop/sessions P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
NousResearch/hermes-agent#145383 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
enhancement p2 setup
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day