[FEAT] Add ES Modules support #773
Replies: 3 comments
-
|
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: 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... |
Beta Was this translation helpful? Give feedback.
-
|
@kevinfaveri thanks! |
Beta Was this translation helpful? Give feedback.
-
|
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! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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" fromI got this log monkey patching the code.... But the library just returns:
UnhandledPromiseRejectionWarning: Error: could not load 'config.maizzle.js'Beta Was this translation helpful? Give feedback.
All reactions