-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publint fixes #15
Publint fixes #15
Conversation
package.json
Outdated
"types": "./dist/types/index.d.ts", | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
"require": "./dist/cjs/index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing part of the fix here — can we rename the 'require' entrypoint to have a .cjs
file extension? The effect of adding "type": "module"
is that Node.js and various build tools will assume .js
files are ESM by default, unless otherwise specified by a .cjs
or .mjs
file extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donmccurdy do you know of a better way to change the file extension (currently using mv
as I can't figure out how to change behavior of tsc
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. Blocked in tsc by microsoft/TypeScript#49462. Alternative build tools ocular-dev-tools or microbundle would avoid the issue, see the ktx-parse / publint link above for example. But after discussion we're not inclined to swap out the build tool and will keep the mv
for now, at least until the v9 migration settles down.
Fixes based on issues reported by https://publint.dev/[email protected]