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

feat: support cjs extension for config #873

Merged
merged 1 commit into from Jan 9, 2023
Merged

feat: support cjs extension for config #873

merged 1 commit into from Jan 9, 2023

Conversation

leonsilicon
Copy link
Contributor

When using Maizzle in a project with "type": "module", the configuration file config.js is treated like an ESM module, which causes an error (since it's written in CommonJS). To fix this, it should be renamed to config.cjs, but it doesn't seem like Maizzle supports this just yet (since it relies on Node's auto-extension resolution algorithm, which doesn't work for the .cjs extension).

This PR just adds some explicit checks for .cjs files in the configuration loader so that Maizzle correctly loads configuration files that end with a .cjs extension.

Let me know if you have any questions!

@cossssmin
Copy link
Member

Hey, thanks so much for this, could you please direct it at the next branch instead, so we can include it in the upcoming 4.4.0 feature release?

@leonsilicon leonsilicon changed the base branch from master to next January 5, 2023 13:25
@cossssmin cossssmin merged commit 8fafae5 into maizzle:next Jan 9, 2023
@cossssmin
Copy link
Member

Thanks!

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