Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: further clarify package.json "type" field
Added sentence about the type field not affecting .mjs and .cjs files.
  • Loading branch information
tamias committed Dec 31, 2019
commit 1d6349746945f535570423555f612538bbcc5260
3 changes: 3 additions & 0 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ future-proof the package in case the default type of Node.js ever changes, and
it will also make things easier for build tools and loaders to determine how the
files in the package should be interpreted.

Regardless of the value of the `"type"` field, `.mjs` files are always treated
as ES modules and `.cjs` files are always treated as CommonJS modules.
Comment thread
tamias marked this conversation as resolved.
Outdated

### Package Scope and File Extensions

A folder containing a `package.json` file, and all subfolders below that
Expand Down