We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ea7e03 commit da150f4Copy full SHA for da150f4
doc/api/esm.md
@@ -637,6 +637,12 @@ CommonJS entry point for `require`.
637
}
638
```
639
640
+The above example uses explicit extensions `.mjs` and `.cjs`.
641
+If your files use the `.js` extension, `"type": "module"` will cause such files
642
+to be treated as ES modules, just as `"type": "commonjs"` would cause them
643
+to be treated as CommonJS.
644
+See [Enabling](#esm_enabling).
645
+
646
```js
647
// ./node_modules/pkg/index.cjs
648
exports.name = 'value';
0 commit comments