Skip to content

Commit

Permalink
fileURLToPath
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Aug 27, 2024
1 parent b95aa80 commit b5eae79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/0.5-vanilla-esm/migrate.mjs
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down

0 comments on commit b5eae79

Please sign in to comment.