chore: fix read migration require regression

This commit is contained in:
Dan Ribbens
2024-03-04 17:02:22 -05:00
parent 610276f66b
commit a55e991bfa

View File

@@ -35,8 +35,8 @@ export const readMigrationFiles = async ({
return Promise.all(
files.map(async (filePath) => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const migration = require(filePath) as Migration
// eval used to circumvent errors bundling
const migration = eval(`require('${filePath.replaceAll('\\', '/')}')`)
migration.name = path.basename(filePath).split('.')?.[0]
return migration
}),