forked from sissbruecker/linkding-extension
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
49 lines (47 loc) · 1.36 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
import resolve from "@rollup/plugin-node-resolve"
import commonjs from "@rollup/plugin-commonjs"
import svelte from "rollup-plugin-svelte"
import zip from "rollup-plugin-zip"
import postcss from "rollup-plugin-postcss"
import { terser } from "rollup-plugin-terser"
import { chromeExtension, simpleReloader } from "rollup-plugin-chrome-extension"
import { emptyDir } from "rollup-plugin-empty-dir"
const production = !process.env.ROLLUP_WATCH
export default {
input: "manifest.json",
// output: {
// dir: "dist",
// format: "esm",
// },
output: {
format: "esm",
name: "briefkasten",
dir: "dist",
// file: 'build/bundle.js'
},
plugins: [
// always put chromeExtension() before other plugins
chromeExtension(),
simpleReloader(),
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production,
},
}),
postcss({ minimize: production }),
// the plugins below are optional
resolve({
browser: true, // @NOTE: OG
dedupe: ["svelte"],
}),
// https://github.com/rollup/plugins/tree/master/packages/commonjs
commonjs(),
// Empties the output dir before a new build
emptyDir(),
// If we're building for production, minify
production && terser(),
// Outputs a zip file in ./releases
production && zip({ dir: "releases" }),
],
}