Skip to content

Commit f05cc51

Browse files
committed
changeset
1 parent 7e6385b commit f05cc51

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'bob-the-bundler': major
3+
---
4+
5+
Drop "module" package.json field
6+
7+
The field was just a proposal and was never officially (and fully) defined by Node. Node instead uses (and recommends) the ["exports" field](https://nodejs.org/api/packages.html#exports).

.changeset/rare-lemons-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'bob-the-bundler': major
3+
---
4+
5+
Drop "typescript" package.json field

.changeset/wise-tigers-roll.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'bob-the-bundler': major
3+
---
4+
5+
"main" package.json field matches the location of "type" output
6+
7+
> The "type" field defines the module format that Node.js uses for all .js files that have that package.json file as their nearest parent.
8+
>
9+
> Files ending with .js are loaded as ES modules when the nearest parent package.json file contains a top-level field "type" with a value of "module".
10+
>
11+
> If the nearest parent package.json lacks a "type" field, or contains "type": "commonjs", .js files are treated as CommonJS. If the volume root is reached and no package.json is found, .js files are treated as CommonJS.
12+
13+
_[Node documentation](https://nodejs.org/api/packages.html#type)_

0 commit comments

Comments
 (0)