@@ -435,22 +435,38 @@ export class MiniflareCore<
435435 const mounts = options . CorePlugin
436436 . mounts as MiniflareCoreOptions < Plugins > [ "mounts" ] ;
437437 if ( mounts ) {
438- const defaultMountOptions = {
439- // Copy watch option
440- watch : this . #watching || undefined ,
441- // Copy storage persistence options, we want mounted workers to share
442- // the same underlying storage for shared namespaces.
443- // (this tight coupling makes me sad)
444- kvPersist : resolveStoragePersist ( rootPath , options . KVPlugin ?. kvPersist ) ,
445- cachePersist : resolveStoragePersist (
446- rootPath ,
447- options . CachePlugin ?. cachePersist
448- ) ,
449- durableObjectsPersist : resolveStoragePersist (
450- rootPath ,
451- options . DurableObjectsPlugin ?. durableObjectsPersist
452- ) ,
453- } ;
438+ // Always copy watch option
439+ const defaultMountOptions : {
440+ watch ?: boolean ;
441+ kvPersist ?: boolean | string ;
442+ cachePersist ?: boolean | string ;
443+ durableObjectsPersist ?: boolean | string ;
444+ } = { watch : this . #watching || undefined } ;
445+
446+ // Copy defined storage persistence options, we want mounted workers to
447+ // share the same underlying storage for shared namespaces.
448+ // (this tight coupling makes me sad)
449+ const kvPersist = resolveStoragePersist (
450+ rootPath ,
451+ options . KVPlugin ?. kvPersist
452+ ) ;
453+ const cachePersist = resolveStoragePersist (
454+ rootPath ,
455+ options . CachePlugin ?. cachePersist
456+ ) ;
457+ const durableObjectsPersist = resolveStoragePersist (
458+ rootPath ,
459+ options . DurableObjectsPlugin ?. durableObjectsPersist
460+ ) ;
461+ if ( kvPersist !== undefined ) {
462+ defaultMountOptions . kvPersist = kvPersist ;
463+ }
464+ if ( cachePersist !== undefined ) {
465+ defaultMountOptions . cachePersist = cachePersist ;
466+ }
467+ if ( durableObjectsPersist !== undefined ) {
468+ defaultMountOptions . durableObjectsPersist = durableObjectsPersist ;
469+ }
454470
455471 // Create new and update existing mounts
456472 for ( const [ name , rawOptions ] of Object . entries ( mounts ) ) {
0 commit comments