Closed mysuf closed 8 months ago
I decided to go mjs way instead of type: module, but umzug can't handle these files atm.
mjs
type: module
require doesn't work with esm so then maybe it would be nice to make resolver async so I can handle these files with dynamic import.
Now I made it work like this:
resolve: ({ name, path, context }) => { return { // adjust the parameters Umzug will // pass to migration methods when called name, up: async () => { const { up } = await import(path); return up({ context }); }, down: async () => { const { down } = await import(path); return down({ context }); }, }; },
Thanks
Closing in favour of #608
I decided to go
mjs
way instead oftype: module
, but umzug can't handle these files atm.require doesn't work with esm so then maybe it would be nice to make resolver async so I can handle these files with dynamic import.
Now I made it work like this:
Thanks