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
Right now, inline-style-prefixer cannot be used as an esmodule in node. The module field of the package.json is never read by node (ref) and manually importing inline-style-prefixer/es does not work either since:
"type": "module" is not defined on the package.json so we can't use the "import" syntax
imports don't contain file extensions (as in import createPrefixer from './createPrefixer.js' instead of import createPrefixer from './createPrefixer'), which is required by the esm specification (ref)
add a exports field in package.json to ask node to include the esm version "imports" call and keep the cjs version on "require"
I have not written a PR yet for that because I fear adding the exports field might be a breaking change. I wonder if we should use something like nodejs/help#3993 (comment)
I also wonder if keeping a cjs version is still relevant today, or if an esmodule is enough.
Right now,
inline-style-prefixer
cannot be used as an esmodule in node. Themodule
field of the package.json is never read by node (ref) and manually importinginline-style-prefixer/es
does not work either since:"type": "module"
is not defined on the package.json so we can't use the "import" syntaximport createPrefixer from './createPrefixer.js'
instead ofimport createPrefixer from './createPrefixer'
), which is required by the esm specification (ref)To fix this, we could:
"type": "module"
to the package.jsonexports
field in package.json to ask node to include the esm version "imports" call and keep the cjs version on "require"I have not written a PR yet for that because I fear adding the
exports
field might be a breaking change. I wonder if we should use something like nodejs/help#3993 (comment)I also wonder if keeping a cjs version is still relevant today, or if an esmodule is enough.
For context on why I want an ES module, you can see necolas/react-native-web#2668 or vikejs/vike#1637 (reply in thread)
The text was updated successfully, but these errors were encountered: