-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add CommonJS build script #223
Conversation
✅ Deploy Preview for popover-polyfill ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
@FelipeSilva916 Thanks! Because the default index.ts
entry point has no exports, it looks like the resulting CJS build is identical to the existing ESM built, except that it has "use strict";
. Is this actually useful for CJS environments? I was assuming #222 was requesting a CJS bundle of index-fn.ts
, which would differ meaningfully between ESM and CJS.
cc @myasonik
I think we'll also want to document this in the README file, as well as add a require
path to the exports
setting in package.json
.
Co-authored-by: Jonny Gerig Meyer <jonny@oddbird.net>
@jgerigmeyer What are your thoughts on the updates so far? |
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.
@FelipeSilva916 Would #224 work for you as an alternative?
@jgerigmeyer Let me give that a try |
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.
@FelipeSilva916 If you revert the remaining changes to index-fn.ts
(or explain to me why they're needed?), I'm fine merging this.
Co-authored-by: Jonny Gerig Meyer <jonny@oddbird.net>
Co-authored-by: Jonny Gerig Meyer <jonny@oddbird.net>
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.
Looks good -- thanks!
Description
This pull request adds a CommonJS (CJS) build script to the
@oddbird/popover-polyfill
package. This change allows the polyfill to be used in environments that require CommonJS modules.This pull request includes a small change to the
package.json
file to add a new build script for CommonJS format.This PR Takes care of the following issue: #222
Build script addition:
package.json
: Added a new script"build:cjs"
to bundle the source filesrc/index.ts
into CommonJS format with source maps.Steps to test/reproduce
This pull request includes an update to the build scripts in the
package.json
file to support CommonJS module format.Added to package.json