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

Are ES6 imports supported in 4.0.0? #55

Open
nitzano opened this issue Dec 5, 2019 · 2 comments
Open

Are ES6 imports supported in 4.0.0? #55

nitzano opened this issue Dec 5, 2019 · 2 comments

Comments

@nitzano
Copy link

nitzano commented Dec 5, 2019

In the 4.0.0's version info it says:

Given that nodejs has come a long way and async/await and other modern ES features have long been released, I decided to remove the babel project. Babel was causing more trouble than solving at this point and makes the maintenance of this package difficult.

However after reading the code it is still unclear how migrate-mongoose can now be used with ES6 files containing import and export statements without a transpiler. Can you please add an example or explain how can you now run migrations with ES6 files as stated in the current README.md file here:

https://github.com/balmasi/migrate-mongoose/blob/master/README.md#migrations1459287720919-my-migrationjs

@nitzano nitzano changed the title Is ES6 supported in 4.0.0? Are ES6 imports supported in 4.0.0? Dec 5, 2019
@rip32700
Copy link

same question here

@ngeren
Copy link

ngeren commented Mar 5, 2020

I was able to get ES6 imports to work in my migrations by wrapping the cli within the module. I could never get the migrate binary the project ships with to work with them.

  1. Create a new file in your project that imports "cli" from the module:
    import cli from 'migrate-mongoose/src/cli'
  2. Execute with esm or add as a yarn script, ie: node -r esm db/src/migrate.js

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

No branches or pull requests

3 participants