-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.ts
More file actions
42 lines (38 loc) · 992 Bytes
/
module.ts
File metadata and controls
42 lines (38 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineNuxtModule, addPlugin, createResolver, addComponentsDir } from '@nuxt/kit'
import { deepMerge } from '@owdproject/core/runtime/utils/utilCommon'
export default defineNuxtModule({
meta: {
name: 'owd-module-fs',
configKey: 'fs',
},
defaults: {
mounts: {},
fileAssociations: {
mp4: 'video-player',
webm: 'video-player',
mp3: 'audio-player',
txt: 'text-editor',
gif: 'image-viewer',
webp: 'image-viewer',
jpg: 'image-viewer',
png: 'image-viewer',
}
},
setup(_options, _nuxt) {
const { resolve } = createResolver(import.meta.url)
_nuxt.options.runtimeConfig.public.desktop.fs = deepMerge({
mounts: {
'/home': 'WebStorage',
'/.cache': 'InMemory',
'/.trash': 'InMemory',
}
}, _options)
addComponentsDir({
path: resolve('./runtime/components'),
})
addPlugin({
src: resolve('./runtime/plugin'),
mode: 'client',
})
},
})