-
Notifications
You must be signed in to change notification settings - Fork 60
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!: Dual-Support ESM & CJS #662
Conversation
I think my only concern with not using babel is that we have some unique plugins we wrote for additional functionality. I'm also concerned that if there's an error during compilation (or installation or whatever), the post-compile script won't run and then the library would fail. Seems safer to just convert those files to .cjs but I'm curious why you're interested in getting rid of babel. |
@sofisl With this strategy we can avoid
I'm not sure I understand - if the compilation fails then library is already broken
Unfortunately there are some gotchas with this approach; notably with renaming imports referencing these files. Between the time the original doc was written and today the space has improved and simplified a ton. |
Warning: This pull request is touching the following templated files:
|
I'm down to try it once we move the node step into compilation (vs. postcompile). |
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.
Please combine the compile & postcompile step.
Notable Changes
tsconfig.json
defaulting topreserve
('esm').package.json
inbuild/esm
so that all.js
s there are loaded as ESMgts clean
step before compilation and usingtsc -b
gts
v7'scomposite
flag:composite: true
intsconfig-google.json
google/gts#899./path
->./path.js
) and fixed the directory imports (/
->/index.js
)pack-n-play
🦕