-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
68 lines (62 loc) · 1.45 KB
/
index.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const { resolve } = require('path')
module.exports = (options = {}, context) => ({
define() {
const {
metingApi = 'https://api.i-meto.com/meting/api',
meting = {},
aplayer = {},
mobile = {},
defaultCover = 'https://github.com/SigureMo.png',
} = options
const { auto = '', server = '', type = '', mid = '' } = meting
const {
additionalAudios = [],
mini = null,
autoplay = false,
theme = '#b7daff',
loop = 'all',
order = 'list',
preload = 'auto',
volume = 0.7,
customAudioType,
mutex = true,
lrcType = 0,
listFolded = false,
listMaxHeight = 250,
storageName = 'vuepress-plugin-meting',
} = aplayer
const { cover = true, lrc = true } = mobile
return {
__METING_API__: metingApi,
__METING_OPTIONS__: {
auto,
server,
type,
mid,
},
__APLAYER_OPTIONS__: {
additionalAudios,
mini,
autoplay,
theme,
loop,
order,
preload,
volume,
customAudioType,
mutex,
lrcType,
listFolded,
listMaxHeight,
storageName,
},
__MOBILE_OPTIONS__: {
cover,
lrc,
},
__DEFAULT_COVER__: defaultCover,
}
},
enhanceAppFiles: resolve(__dirname, './lib/enhanceAppFile.js'),
globalUIComponents: options.meting !== undefined ? ['MetingGlobal'] : undefined,
})