Skip to content

Conversation

@RyanZim
Copy link
Collaborator

@RyanZim RyanZim commented Oct 25, 2022

Depends on #970

Review commit-by-commit.

Breaking change, as it switches from main to exports in package.json, outlawing all subpath imports except those explicitly specified.

Fixes #746

@RyanZim RyanZim added this to the 11.0.0 milestone Oct 25, 2022
This was referenced Oct 25, 2022
Base automatically changed from ryan/fs-readv to master October 31, 2022 18:48
"exports": {
".": "./lib/index.js",
"./esm": "./lib/esm.mjs"
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered using export conditions so it automatically exports the ESM version when import is used instead of require?

"exports": {
	".": {
		"require": "./lib/index.js",
		"import": "./lib/esm.mjs"
	},
	"./esm": "./lib/esm.mjs"
}

I added the ./esm in case, but this way, you may not even need the ./esm endpoint:

"exports": {
	"require": "./lib/index.js",
	"import": "./lib/esm.mjs"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to do that, because the ESM version doesn't export normal fs methods like the CJS version does. Since it's a different feature set, it's best to be explicit. Otherwise, I'd definitely do this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the regression? Sounds it can be kept with:

export * from 'fs';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ESM

3 participants