fix excessively long build times

This commit is contained in:
sk1982 2024-03-24 22:47:29 -04:00
parent 6a3358e03e
commit f58bec53f3

View File

@ -1,7 +1,8 @@
export async function register() { export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') { if (process.env.NEXT_RUNTIME === 'nodejs') {
if (['true', 'yes', '1'].includes(process.env.AUTOMIGRATE?.toLowerCase()!)) { if (['true', 'yes', '1'].includes(process.env.AUTOMIGRATE?.toLowerCase()!)) {
const DBMigrate = require('db-migrate'); // using require here increases build times to like 10 minutes for some reason
const DBMigrate = await eval('imp' + 'ort("db-migrate")');
const dbmigrate = DBMigrate.getInstance(true); const dbmigrate = DBMigrate.getInstance(true);
await dbmigrate.up(); await dbmigrate.up();
} }