-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
98 lines (95 loc) · 2.11 KB
/
rollup.config.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import copy from 'rollup-plugin-copy';
import resolve from 'rollup-plugin-node-resolve';
import cleanup from 'rollup-plugin-cleanup';
let firefoxDir = 'builds/firefox';
let jsFirefoxDir = `${firefoxDir}/js`;
function my_copy() {
return copy({
targets: [
{ src: 'src/manifest.json', dest: firefoxDir },
{ src: 'src/css', dest: firefoxDir },
{ src: 'src/html', dest: firefoxDir },
{ src: 'src/img', dest: firefoxDir },
{ src: 'src/json', dest: firefoxDir },
{ src: 'src/js/background_scripts/navigation.js', dest: `${jsFirefoxDir}/background_scripts` },
{ src: 'src/js/external', dest: `${jsFirefoxDir}` }
],
});
}
export default [{
input: 'src/js/content_scripts/spoilers.js',
output: {
file: `${jsFirefoxDir}/content_scripts/spoilers.js`,
format: 'iife'
},
plugins: [
my_copy(),
cleanup({
comments: 'none'
})
]
},
{
input: 'src/js/content_scripts/vod.js',
output: {
file: `${jsFirefoxDir}/content_scripts/vod.js`,
format: 'iife'
},
plugins: [
resolve({
customResolveOptions: {
moduleDirectory: 'node_modules'
}
}),
cleanup({
comments: 'none'
})
]
},
{
input: 'src/js/internal/settings.js',
output: {
file: `${jsFirefoxDir}/internal/settings.js`,
format: 'iife'
},
plugins: [
cleanup({
comments: 'none'
})
]
},
{
input: 'src/js/background_scripts/settings.js',
output: {
file: `${jsFirefoxDir}/background_scripts/settings.js`,
format: 'iife',
},
plugins: [
resolve({
customResolveOptions: {
moduleDirectory: 'node_modules'
}
}),
cleanup({
comments: 'none'
})
]
},
{
input: 'src/js/content_scripts/live.js',
output: {
file: `${jsFirefoxDir}/content_scripts/live.js`,
format: 'iife'
},
plugins: [
resolve({
customResolveOptions: {
moduleDirectory: 'node_modules'
}
}),
cleanup({
comments: 'none'
})
]
}
]