diff options
| author | Guy Bedford <guybedford@gmail.com> | 2020-03-12 02:11:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-12 02:11:03 +0200 |
| commit | 748cbad9649e8822dd3f01dd81226a456541305e (patch) | |
| tree | a61f3c83b747be9ba45954586f198be6863be6f0 | |
| parent | b6e8394330537bce92dc49f94d6dc65ef418e29a (diff) | |
| download | node-new-doc-exports-pattern.tar.gz | |
linting fixesdoc-exports-pattern
| -rw-r--r-- | doc/api/esm.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md index 42f92b98aa..8da0554188 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -194,8 +194,9 @@ environment, including whether the package is referenced via `require` or via If both `"exports"` and `"main"` are defined, the `"exports"` field takes precedence over `"main"`. -Both `"main"` and `"exports"` entry points are not specific to ES modules or CommonJS; -`"main"` will be overridden by `"exports"` in a `require` so it is not a CommonJS fallback. +Both `"main"` and `"exports"` entry points are not specific to ES modules or +CommonJS; `"main"` will be overridden by `"exports"` in a `require` so it is +not a CommonJS fallback. This is important with regard to `require`, since `require` of ES module files throws an error in all versions of Node.js. To create a package that works both @@ -849,8 +850,8 @@ can either be an URL-style relative path like `'./file.mjs'` or a package name like `'fs'`. Like in CommonJS, files within packages can be accessed by appending a path to -the package name; unless the package’s `package.json` contains an [`"exports"` -field][], in which case files within packages need to be accessed via the path +the package name; unless the package’s `package.json` contains an `"exports"` +field, in which case files within packages need to be accessed via the path defined in `"exports"`. ```js |
