Skip to content
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

fix backward compability for cjs exports #41

Merged
merged 1 commit into from
Jan 17, 2023
Merged

Conversation

ffortier
Copy link

Fixes #40

Some files were missing from the repos, so I had to put place holders for tsconfig.json, tsconfig-esm.json, tsconfig-cjs.json and fixup.sh.

When loading from a cjs import, mkdir will be available directly instead of being wrapped in a es6 module.

isaacs added a commit that referenced this pull request Jan 16, 2023
They were ignored by the .gitignore, whoops.

Re: #41
EDIT(@isaacs): rebased on main, since this commit was created while the
tsconfig and fixup.sh were mistakenly omitted.

PR-URL: isaacs#41
Credit: @ffortier
Close: isaacs#41
Reviewed-by: @isaacs
@isaacs
Copy link
Owner

isaacs commented Jan 16, 2023

Ah, how embarrassing that my old .gitignore file was keeping those out, I didn't notice that in the rewrite.

What you did here was surprisingly close to what I already had in place, and I was able to incorporate it pretty easily. Having an index-cjs that just re-exports the default is really clever, and saves the whole require('mkdirp').default wart, I love it! I'm going to copy this in my other hybrid modules.

@isaacs isaacs closed this in 203a7c9 Jan 17, 2023
@isaacs isaacs merged commit 203a7c9 into isaacs:main Jan 17, 2023
@isaacs
Copy link
Owner

isaacs commented Jan 17, 2023

Shipped on v2.1, thanks for the trick!

isaacs added a commit to isaacs/rimraf that referenced this pull request Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cjs backward compatibility
2 participants