-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
70 lines (66 loc) · 2.09 KB
/
rollup.config.ts
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
import cleanOnce from "./rollup_scripts/rollup-plugin-clean-once";
import eslintPlugin from "@rollup/plugin-eslint";
import typescript from "@rollup/plugin-typescript";
import prettierBuildStart from "./rollup_scripts/rollup-plugin-prettier-build-start";
import staticFiles from "./rollup_scripts/rollup-plugin-static-files";
import watch from "./rollup_scripts/rollup-plugin-watch-additional";
function eslint() {
return eslintPlugin({ throwOnError: true });
}
function prettierSrc() {
return prettierBuildStart("'src/**/*.{js,ts}'");
}
export default [
{
input: "src/js/detectKvstoreMeta.ts",
output: [{
file: "dist/chrome/contentKvstore.js",
format: "iife",
}, {
file: "dist/edge/contentKvstore.js",
format: "iife"
}, {
file: "dist/firefox/contentKvstore.js",
format: "iife"
}],
plugins: [cleanOnce(), typescript(), prettierSrc(), eslint()]
},
{
input: "src/js/background.ts",
output: [{
file: "dist/chrome/background.js",
format: "iife"
}, {
file: "dist/edge/background.js",
format: "iife"
}, {
file: "dist/firefox/background.js",
format: "iife"
}],
plugins: [typescript(), prettierSrc(), eslint()]
},
{
input: "src/js/popup.ts",
output: [{
file: "dist/chrome/popup.js",
format: "iife",
plugins: [staticFiles("config/v3/")]
}, {
file: "dist/edge/popup.js",
format: "iife",
plugins: [staticFiles("config/v3/")]
}, {
file: "dist/firefox/popup.js",
format: "iife",
plugins: [staticFiles("config/v2/")]
}],
plugins: [
typescript(),
prettierSrc(),
eslint(),
staticFiles(["images/", "src/css/", "src/html/"]),
staticFiles("_locales/", { keepDir: true }),
watch(["images/", "src/css/", "src/html/", "_locales/", "config/"])
]
}
];