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

add support for svgo.config.cjs files in esm environments #879

Merged
merged 1 commit into from
Aug 15, 2023
Merged

add support for svgo.config.cjs files in esm environments #879

merged 1 commit into from
Aug 15, 2023

Conversation

mckelveygreg
Copy link
Contributor

Summary

In our vite project, since it is "type": "module" (ESM), the cli wouldn't accept svgo config files as a regular .js file that wasn't esm. This PR enables the cli to use .cjs.

Addresses

Test plan

  • I ran the modified code in our vite environment and it accepted svgo.config.cjs
  • I've added a test.
  • I wasn't able to add error checking for ESM detection as I think jest is doing some funny things there?

Thank you for the wonderful library and let me know if I can do anything else to this PR 🎉

@vercel
Copy link

vercel bot commented Jun 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svgr ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2023 6:47pm

@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@gregberge gregberge merged commit ae91e2e into gregberge:main Aug 15, 2023
7 checks passed
@mckelveygreg mckelveygreg deleted the feat/svgo-cjs branch August 15, 2023 06:57
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