cli icon indicating copy to clipboard operation
cli copied to clipboard

Support import/export Statements Using ESM

Open rtablada opened this issue 7 years ago • 4 comments

There has been a lot of discussion around Babel transforms in #112 for years and there doesn't seem to be much progress since babel is fairly environment/team specific in its implementation.

From reading through the thread, the major theme seems to be more around import and export syntax. This can be solved using ESM which is a production ready and well supported module loader for Node.

An --esm flag or esm true option could be added to CLI to support ESM loading for CLI commands.

A more flexible option could be to allow users to pass in their own require definition that could be used in the CLI for project requires and module loading although this could cause some 🐉s to pop up.

rtablada avatar May 22 '18 20:05 rtablada

I hope to work on a proof of concept for this soon, but wanted to put out an issue to gauge interest as well.

rtablada avatar May 22 '18 20:05 rtablada

I use ESM to load ES Modules instead of Babel. So this is a wanted feature.

Thanks, @rtablada :+1:

sonufrienko avatar Jan 11 '19 09:01 sonufrienko

Any update on it?

SpiritualDixit avatar Jun 16 '21 11:06 SpiritualDixit

sequelize-cli migration:generate should also generate migrations with ESM syntax when project package.json already has type=module

mariusa avatar Feb 15 '22 09:02 mariusa