Skip to content

Commit

Permalink
doc: further clarify package.json "type" field
Browse files Browse the repository at this point in the history
Added sentence about the type field not affecting .mjs and .cjs files.
  • Loading branch information
tamias committed Dec 31, 2019
1 parent fccd01b commit 1d63497
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/esm.md
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.

### Package Scope and File Extensions

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

0 comments on commit 1d63497

Please sign in to comment.