Commit 04aa7d9
committed
Add exports to package.json to satisfy nodejs --experimental-module users
Fixes #206
This ensures that consumers using --experimental-modules with node 12+
will import the esm version of this package.
This package's export MUST have .mjs file extension... (because
otherwise the entire package must be specified as type: module)
This package's export MUST use exports field in the package.json
see https://nodejs.org/api/packages.html#conditional-exports
Not sure how to test this with a bunch of different project styles..
webpack and other loaders _should_ be fine with importing from the
`module` field with a `.mjs` file extension?1 parent cc4f9ae commit 04aa7d9
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | | - | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
0 commit comments