-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
In my package.json I have 'type':'module'
and in my code I write import babel from '@rollup/plugin-babel
. The package.json of the latter contains "main": "dist/index.js", "module": "dist/index.es.js"
but there is no 'type':'module'
. In turn nodejs concludes that @rollup/plugin-babel
is commonjs and there is no way to use the default import from dist/index.es.js
. This means I have to write babel.default
in my code and I cannot use import {babel} from '@rollup/plugin-html
.
• When NodeJS imports a package(.json) that contains 'main' and 'module' fields, but no 'type' field, from a package containing 'type':'module'
, implicitly conclude that the imported package is an ES6 module.
jsmithjgonggrijp
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.