Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crarify which versions support package.json:"type":"module" #33143

Closed
dilyanpalauzov opened this issue Apr 29, 2020 · 1 comment
Closed

Crarify which versions support package.json:"type":"module" #33143

dilyanpalauzov opened this issue Apr 29, 2020 · 1 comment

Comments

@dilyanpalauzov
Copy link

https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663 says that Node 13.2.0 is the first version to understand in package.json "type":"module". This was the reason I switched to Node 13.

Now https://nodejs.org/docs/latest-v12.x/api/esm.html#esm_package_json_type_field says that v12 supports this "type":"module" option.

Apparently this option is not valid for all Node v12 releases.

Please amend the documentation to state since which v12 and v13 releases this option is enabled, so that this information can be included in the package.json: "engines" field. Ideally also provide information how the engines field should look like.

@aduh95
Copy link
Contributor

aduh95 commented Apr 29, 2020

Node.js v12 does support it, however you need to use the --experimental-modules CLI flag to enable the feature. The removal of the flag is discussed on #33055.

I get your point regarding the lack of clear information for what version which feature. I'm working on refactoring this part of the docs on #32970, I could add info about which version introduced support for each package.json field.

aduh95 added a commit to aduh95/node that referenced this issue May 22, 2020
Documents package.json supported fields.

Fixes: nodejs#33143
aduh95 added a commit to aduh95/node that referenced this issue Aug 29, 2020
MylesBorins pushed a commit that referenced this issue Sep 24, 2020
Fixes: #33143

PR-URL: #34970
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95 added a commit to aduh95/node that referenced this issue Oct 23, 2020
Fixes: nodejs#33143

PR-URL: nodejs#34970
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this issue Nov 3, 2020
Fixes: #33143

Backport-PR-URL: #35757
PR-URL: #34970
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this issue Nov 16, 2020
Fixes: #33143

Backport-PR-URL: #35757
PR-URL: #34970
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
joesepi pushed a commit to joesepi/node that referenced this issue Jan 8, 2021
Fixes: nodejs#33143

PR-URL: nodejs#34970
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants