Skip to content

docs: refine conditional exports documentation

Rodrigo Muino Tomonari requested to merge doc-exports-pattern into master

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), or vcbuild test (Windows) passes
  • [] tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading