[FEAT] Add ES Modules support
- Maizzle Version: 3.0.0
- Node.js Version: 14
Using maizzle version 3.0.0 with its Cli it does not load the config file if the project has "type": "module" specified in the package.json:
Instead rename config.maizzle.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from
I got this log monkey patching the code.... But the library just returns:
UnhandledPromiseRejectionWarning: Error: could not load 'config.maizzle.js'

For anyone reading this: a workaround, not proper ES Modules support, is using a JSON file as the config file, which will not trigger NodeJS ES Modules restrictions:
config.local.js -> config.local.json
This will work because commonjs (which maizzle uses) syntax support will try to implicit import JS or JSON files... And if you use a JSON file, Node JS es modules import rules will not apply...
@kevinfaveri thanks!
Converting this into a discussion for now, as it'll be a while until we can add proper ES modules support, given the state of the ecosystem and the dependencies in Maizzle. Thanks!