Open
Description
Describe the bug feature (it's a feature I guess)
Context: Resolving external deps in vite.config.ts
vite/packages/vite/src/node/config.ts
Lines 983 to 984 in 128f09e
conditions
is always empty, but we can specify a value via node --conditions=dev
or NODE_OPTIONS='--conditions=dev' node
.
Suggested solution
I suggest that we should read both process.env
and process.execArgv
, and parse & merge them. It's a bit complex because there are tons of options in Node (and V8).
Alternative
Or we can just use a Regex to match it.
// 3 cases
node --conditions=dev
node --conditions dev
node -C dev
Therefore, I wonder if there is a better solution can this issue.