Closed mtdvlpr closed 1 year ago
It doesn't resolve the issue with import ... from "fs-extra/esm"
though. 🤔
It doesn't have to, right? Importing from fs-extra will get the esm version if I'm not mistaken.
It doesn't have to, right? Importing from fs-extra will get the esm version if I'm not mistaken.
If I understand @RyanZim's intention correctly, the separate fs-extra/esm
export aims to avoid confusion. Adding the "module" field reintroduces that confusion, because you could then import from fs-extra
and get the ESM module.
We could just add the main
field for now, and that alone would resolve TypeScript issue.
I removed the main
field, since it wasn't needed for backward compatibility with old Node versions, as we don't support Node versions old enough not to support exports
. However, since it seems TS doesn't like this (potentially a bug? see https://github.com/jprichardson/node-fs-extra/issues/979#issuecomment-1331404978), it seems wise to add it back for now.
It doesn't resolve the issue with import ... from "fs-extra/esm" though.
I think that's fine; main
is only needed for TS support, and if you're using TS, you already have named import support; there's no reason to use fs-extra/esm
in TS.
@caugner is correct; we don't want to add module
here, as that would be confusing.
Published in v11.1.0 :tada:
Fixes #979