-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
30 lines (27 loc) · 897 Bytes
/
Copy pathrollup.config.js
File metadata and controls
30 lines (27 loc) · 897 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
import { defineConfig } from "rollup";
import metaBlock from "rollup-plugin-userscript-metablock";
import typescript from "@rollup/plugin-typescript";
import { readFileSync } from "fs";
import { env } from "process";
/** @type {import('./package.json')} */
const packageMeta = JSON.parse(readFileSync("./package.json", { encoding: "utf8" }));
// eslint-disable-next-line @cspell/spellchecker
/** @type {import("rollup-plugin-userscript-metablock").MetaValues & Record<string,string>} */
const userScriptMeta = {
author: `${packageMeta.author.name} <${packageMeta.author.email}>`,
version: env.BUILD_VERSION ?? "0.0.0-dev",
};
export default defineConfig({
input: "src/index.ts",
output: {
file: "dist/hardverapro-preview.user.js",
format: "cjs",
},
plugins: [
metaBlock({
file: "./src/meta.json",
override: userScriptMeta,
}),
typescript(),
],
});