You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
polished provides an esm export via module field in package.json . However, Node.js does not support module field. Using exports field and .mjs extension is recommended to provide cjs/esm dual package.
Node.js uses type field and each file extension to decide file type. module field has no effect.
Example
This example shows what files are actually imported when importing packages. prettier has both cjs and mjs exports, and its main field value is "./index.cjs" .
…standard
To meet Node.js standard, 2 things should be fixed:
* ESM file should use `.mjs` extention
instead of `.esm.js`.
* `module` field in `package.json` is not standard way of Node.js. Use
`exports` field instead.
fixstyled-components#649
Summary
polished
provides an esm export viamodule
field inpackage.json
. However, Node.js does not supportmodule
field. Usingexports
field and.mjs
extension is recommended to provide cjs/esm dual package.https://nodejs.org/api/packages.html#packagejson-and-file-extensions
Node.js uses
type
field and each file extension to decide file type.module
field has no effect.Example
This example shows what files are actually imported when importing packages.
prettier
has bothcjs
andmjs
exports, and itsmain
field value is"./index.cjs"
.Result:
cjs
is selected forpolished
whilemjs
is selected forprettier
.The text was updated successfully, but these errors were encountered: