Skip to content

Conditional exports in resolve@next #209

@coreyfarrell

Description

@coreyfarrell

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:

".": {
  "import": "./index.mjs",
  "default": "./index.js"
}

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:

		"./core": [
			{
				"default": "./lib/core.js"
			},
			"./lib/core.js"
		],

Couldn't this be reduced to "./core": "./lib/core.js"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions