Skip to content

Commit

Permalink
fix!: change nitrojs build preset
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Aug 9, 2024
1 parent faa5668 commit de0fea3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps/web/server/preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { resolve } from 'node:path'
import { cp, mkdir } from 'node:fs/promises'
import type { NitroPreset } from 'nitropack'

export default <NitroPreset>{
extends: 'node-server',
hooks: {
async compiled(nitro) {
/**
* Copy database migrations to the output directory
*/
const source = resolve(nitro.options.srcDir, 'core/database/migrations')
const destination = resolve(nitro.options.output.serverDir, 'database/migrations')

await mkdir(destination, { recursive: true })
await cp(source, destination, { recursive: true })
},
},
}

0 comments on commit de0fea3

Please sign in to comment.