diff --git a/examples/0.5-vanilla-esm/migrate.mjs b/examples/0.5-vanilla-esm/migrate.mjs index bbecb417..21a007f1 100644 --- a/examples/0.5-vanilla-esm/migrate.mjs +++ b/examples/0.5-vanilla-esm/migrate.mjs @@ -1,8 +1,7 @@ import { Umzug, JSONStorage } from 'umzug'; +import { fileURLToPath } from 'url' -const __dirname = new URL('.', import.meta.url).pathname.replace(/\/$/, ''); - -if (Math.random()) throw new Error(`__dirname: ${__dirname}`) +const __dirname = fileURLToPath(new URL('.', import.meta.url)) export const migrator = new Umzug({ migrations: {