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
fixup! Removes trailing space
  • Loading branch information
Trott committed Aug 22, 2020
commit d16973d3231f0653290249b51a6ccee8377b94d4
3 changes: 2 additions & 1 deletion doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,12 @@ CommonJS entry point for `require`.
}
}
```

The above example uses explicit extensions `.mjs` and `.cjs`.
If your files use the `.js` extension, `"type": "module"` will cause such files
to be treated as ES modules, just as `"type": "commonjs"` would cause them
to be treated as CommonJS.
See [Enabling](https://nodejs.org/api/esm.html#esm_enabling).
See [Enabling](#esm_enabling).

```js
// ./node_modules/pkg/index.cjs
Expand Down