evanw / evanw/esbuild

Please clarify how the target property works for Node

Open Beginner friendly
#4,476 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Looking at https://esbuild.github.io/getting-started/#bundling-for-node I can't find any explanation of how this property works or what the valid values are. I can put `'node100'` in that property and it will compile fine. This seems odd ([violation of POLS](https://medium.com/@julietasudjana/stop-doing-magic-embrace-pols-instead-f2fa95c3a7aa)) because I would not expect a non-existent version of Node to actually work. I would expect an error.

So an FAQ that explains how that value is processed would be helpful.

STR: take a config for node, replace the target (node20 etc) and replace with node100.

Expected: error because Node 100 does not exist.

Actual: compilation goes ahead anyway and ... decides what feature set to use based on some internal logic?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the “Bundling for Node” section of the esbuild getting-started guide and review the target configuration behavior using the provided node20/node100 reproduction. Document the valid Node target values and explain how an unrecognized value such as node100 is processed; the guide should answer why compilation proceeds and what feature set is selected.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.