-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
61 lines (58 loc) · 1.35 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
import typescript from "@rollup/plugin-typescript";
import { terser } from "rollup-plugin-terser";
import url from "@rollup/plugin-url";
import commonjs from "@rollup/plugin-commonjs";
import metablock from "rollup-plugin-userscript-metablock";
let terserConfig = {
format: {
comments: true,
semicolons: false,
},
};
const pkg = require("./package.json");
export default [
{
input: "src/client/index.ts",
output: {
file: "dist/client.user.js",
format: "esm",
},
plugins: [
url({
include: ["**/*.css"],
}),
commonjs(),
typescript({ lib: ["dom"] }),
terser(terserConfig),
metablock({
override: {
name: pkg.name,
namespace: "https://github.com/swz-gh/yare-sync",
version: pkg.version,
description: pkg.description,
author: pkg.author,
icon: "https://yare.io/favicon.ico",
match: "https://yare.io/d*/*",
"run-at": "document-start",
grant: "none",
},
}),
],
},
{
input: "src/server/index.ts",
output: {
file: "dist/server.js",
format: "cjs",
},
plugins: [typescript(), terser(terserConfig)],
},
{
input: "src/wrappers/index.ts",
output: {
file: "dist/wrappers.js",
format: "cjs",
},
plugins: [typescript()],
},
];