Skip to content

Commit 8652a7a

Browse files
committed
use nitro:init hook to set dbPath
1 parent e9af18a commit 8652a7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/module.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ export default defineNuxtModule({
9898
nitroConfig.publicAssets.push({ dir: baseDir })
9999
})
100100

101-
nuxt.hook('nitro:build:before', async ctx => {
102-
const dbPath = join(dbFolder, dbName)
103-
config.dbPath = dbPath
101+
nuxt.hook('nitro:init', async nitro => {
102+
if (!isDev) {
103+
config.dbPath = join(nitro.options.output.publicDir, dbFolder, dbName)
104+
}
104105
})
105106

106107
nuxt.hook('close', async () => {

0 commit comments

Comments
 (0)