-
Notifications
You must be signed in to change notification settings - Fork 134
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
feat: new build settings #820
Conversation
babel.config.js
Outdated
[ | ||
'@babel/preset-env', | ||
{ | ||
loose: true, |
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.
what is this for?
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 added this to resolve the Storybook error. It serves the purpose of modifying certain transpile options in Babel, resulting in some differences in the generated code.
But we did not use the 'loose' option, so I removed it, and when there are plugins included in preset-env but not explicitly added, it can cause these errors. I've found and applied these changes to resolve the issue.
babel/babel#11622 (comment)
c4a4bff
to
14fe4c8
Compare
66b488a
to
9324d2f
Compare
9324d2f
to
13d9fc4
Compare
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.
Super awesome job! Thank you @bang9 I really appreciate this!
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.
LGTM, awesome job @bang9 !
I'll merge it after testing in the sample environment. |
07e06a1
to
c3fbea1
Compare
c3fbea1
to
bb49d22
Compare
Changelogs:
If you were using the package in a Native CJS environment, this might have an impact.
You can migrate the path as follows:
Now, precise types based on the source code are used.
index.d.ts
fileBefore
/dist/dist/index.css
,/dist/dist/cjs/dist/index.css
/dist
and/dist/cjs
README.md
,LICESNSE
,CHANGELOG.md
,index.d.ts
scripts/post_build.js
index.d.ts
dist/package.json
After
/dist/dist/index.css
,/dist/dist/cjs/dist/index.css
/dist
and/dist/cjs
README.md
,LICESNSE
,CHANGELOG.md
scripts/post_build.js
dist/package.json
/dist/dist/cjs/dist
.d.ts
filesThe biggest difference is that now we use the exports supported in package.json.
You can find more information here: https://nodejs.org/api/packages.html#subpath-exports
This may result in breaking changes because you can only use modules that are specified in exports.
For example, the
@sendbird/chat/cjs/index.js
file actually exists, but it is not exported in package.json, so you cannot use it in a strict environment.The advantages of this approach are as follows:
For paths that we directly specify in exports, files are assigned accordingly in the esm/cjs environment.
Previously, for individually exported entries (modules) other than the main entry, we had to specify the path directly depending on the module environment.
For example:
package.json example