docs: refine conditional exports documentation
This began as a bigger change of guidance but has been pulled back to a simple docs refactoring.
- Moves exports sugar section up
- Makes conditional exports examples using main form directly
- Explains conditional exports sugar second
- Adds some extra guidance on conditions usage
- Cuts down on some unnecessary explanations to try aid readability
- Removes incorrect statement about export main falling back to package.json main
Resolves https://github.com/nodejs/node/issues/32107.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes - [] tests and/or benchmarks are included
-
documentation is changed or added -
commit message follows commit guidelines