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
It's nice that the next version provides an ES module wrapper using conditional exports. One suggestion could you drop the require condition? The following seems to work:
The big difference is that require('resolve') will not print ExperimentalWarning: Conditional exports is an experimental feature. as default is not part of the conditional exports feature where require is. import('resolve') will produce the warning but that seems reasonable (hopefully this warning will not stay for long).
Also for my own information can you explain why you list sub-paths as:
The reason that the array is always required is that node v13.0 and v13.1 have a bug where although ESM is flagged, "exports" is still read, and they do not understand the object syntax. Thus, the arrays will have to be used in every package i maintain forever, including this one.
I understand why you need the array notation for the main export which provides the ES module wrapper but for the sub-path remaps which do not have conditional exports I'm not sure why you need object notation at all?
Activity
ljharb commentedon Jan 25, 2020
Dropping the
requirecondition makes sense, yes.The reason that the array is always required is that node v13.0 and v13.1 have a bug where although ESM is flagged, "exports" is still read, and they do not understand the object syntax. Thus, the arrays will have to be used in every package i maintain forever, including this one.
coreyfarrell commentedon Jan 25, 2020
Wouldn't 13.0 / 13.1 understand:
I understand why you need the array notation for the main export which provides the ES module wrapper but for the sub-path remaps which do not have conditional exports I'm not sure why you need object notation at all?
ljharb commentedon Jan 25, 2020
If i want the subpaths to work in node 13.0 and 13.1, they also need the array form.
v2.0.0-next.2