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

Allow more ergonomic require of cjs esbuild plugin #713

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

STRd6
Copy link
Contributor

@STRd6 STRd6 commented Sep 8, 2023

This lets us use civetPlugin = require "@danielx/civet/esbuild-plugin" instead of needing to use .default.

We can pick it up in esbuild.civet after publishing.

@STRd6 STRd6 temporarily deployed to build September 8, 2023 20:41 — with GitHub Actions Inactive
@edemaine
Copy link
Collaborator

edemaine commented Sep 8, 2023

According to the tests, this seems to break import esbuildPlugin from "../../source/esbuild-plugin.civet"... ☹️
Oh, but maybe that should be importing from dist.

@edemaine
Copy link
Collaborator

edemaine commented Sep 8, 2023

I read evanw/esbuild#1719 which talks about the fun history here, and followed some of the back links. It seems like conventional-changelog/commitlint#3614 might work for our context, though I don't quite understand why. 🙂

@STRd6 STRd6 temporarily deployed to build September 8, 2023 21:11 — with GitHub Actions Inactive
@STRd6
Copy link
Contributor Author

STRd6 commented Sep 8, 2023

This weird hybrid export hack works but it does create a warning from esbuild.

The only reason for the export default is so ts-node can do an esm import for test coverage purposes.

🤷

@STRd6 STRd6 temporarily deployed to build September 8, 2023 21:24 — with GitHub Actions Inactive
@STRd6 STRd6 temporarily deployed to build September 8, 2023 21:44 — with GitHub Actions Inactive
@STRd6 STRd6 merged commit feef2ed into main Sep 8, 2023
2 of 3 checks passed
@STRd6 STRd6 deleted the better-cjs-plugin-export branch September 8, 2023 21:46
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.

None yet

2 participants