-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
39 lines (35 loc) · 1008 Bytes
/
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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import { chromeExtension, simpleReloader } from "rollup-plugin-chrome-extension";
import { emptyDir } from "rollup-plugin-empty-dir";
import { terser } from "rollup-plugin-terser";
import minifyHTML from "rollup-plugin-minify-html-literals";
import zip from "rollup-plugin-zip";
const isProduction = process.env.NODE_ENV === "production";
export default {
input: "src/manifest.json",
output: {
dir: "dist",
format: "esm",
sourcemap: isProduction ? false : "inline",
},
plugins: [
chromeExtension(),
simpleReloader(),
resolve(),
commonjs(),
typescript(),
emptyDir(),
isProduction && terser(),
isProduction &&
minifyHTML({
options: {
minifyOptions: {
conservativeCollapse: true,
},
},
}),
isProduction && zip({ dir: "releases" }),
],
};