-
Notifications
You must be signed in to change notification settings - Fork 81
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
build: switch to dual package emitting #2746
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"types": "./dist/esm/index.d.ts", |
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.
For backward compability
79d89ad
to
ed88749
Compare
c9aaf4b
to
ff61b51
Compare
"sideEffects": false, | ||
"type": "module", | ||
"main": "./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.
type: module
& main
being CJS seems wrong
"engines": { | ||
"node": ">=16" |
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.
Why is this required? It's a frontend package.
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.
It isn't, to be removed.
Purpose of PR
Note
This is only for v5 alpha/beta pre-releases and won't be merged into
main
Adds setup for emitting 2 package.json files for ESM and CJS, making use of tsconfig-to-dual-package.
This approach has the benefit of clearly declaring what type should be used since it relies on 2 package.json and prevents Node/TypeScript configuration confusion or change for the consumers, and mostly issues with our direct dependency for the icons (Phosphor)
Motivation and readings 🍿
.ts
microsoft/TypeScript#49462