@@ -80,6 +80,11 @@ export interface ModuleOptions {
80
80
* @default process.env.NUXT_HUB_PROJECT_SECRET_KEY
81
81
*/
82
82
projectSecretKey ?: string
83
+ /**
84
+ * The directory used for local miniflare storage (D1, KV, R2, etc.)
85
+ * @default '.data/hub'
86
+ */
87
+ dataHubDir ?: string
83
88
}
84
89
85
90
export default defineNuxtModule < ModuleOptions > ( {
@@ -107,6 +112,8 @@ export default defineNuxtModule<ModuleOptions>({
107
112
// Remote storage
108
113
remote : remoteArg || process . env . NUXT_HUB_REMOTE ,
109
114
remoteManifest : undefined ,
115
+ // Local storage
116
+ dataHubDir : '.data/hub' ,
110
117
// NuxtHub features
111
118
analytics : false ,
112
119
blob : false ,
@@ -378,10 +385,10 @@ export default defineNuxtModule<ModuleOptions>({
378
385
379
386
// Local development without remote connection
380
387
if ( nuxt . options . dev && ! hub . remote ) {
381
- log . info ( ' Using local storage from `.data/ hub`' )
388
+ log . info ( ` Using local storage from [ ${ hub . dataHubDir } ]` )
382
389
383
- // Create the .data/ hub/ directory
384
- const hubDir = join ( rootDir , './.data/ hub' )
390
+ // Create the hub.dataHubDir directory
391
+ const hubDir = join ( rootDir , hub . dataHubDir )
385
392
try {
386
393
await mkdir ( hubDir , { recursive : true } )
387
394
} catch ( e : any ) {
0 commit comments