Repository navigation
Expand file tree
/
Copy pathrollup.config.js
More file actions
71 lines (68 loc) · 1.57 KB
/
Copy pathrollup.config.js
File metadata and controls
71 lines (68 loc) · 1.57 KB
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
71
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import svelte from "rollup-plugin-svelte";
import postcss from "rollup-plugin-postcss";
import sveltePreprocess from "svelte-preprocess";
import typescript from "@rollup/plugin-typescript";
import url from '@rollup/plugin-url';
const production = !process.env.ROLLUP_WATCH;
const commonConfig = {
plugins: [
svelte({
preprocess: sveltePreprocess(),
compilerOptions: {
// enable run-time checks when not in production
dev: !production,
},
}),
postcss({ extract: true, minimize: production }),
// the plugins below are optional
resolve({
dedupe: ["svelte"],
}),
// https://github.com/rollup/plugins/tree/master/packages/commonjs
commonjs(),
typescript({ sourceMap: false }),
url({ limit: 0, fileName: 'assets/[name][extname]', publicPath: '/' }),
],
};
export default [
{
input: 'node_modules/webextension-polyfill/dist/browser-polyfill.js',
output: {
file: 'dist/browser-polyfill.js',
}
},
{
input: ['src/background/index.ts'],
output: {
file: "dist/background/index.js",
format: "esm",
},
...commonConfig,
},
{
input: ['src/content/index.ts'],
output: {
file: "dist/content/index.js",
format: "esm",
},
...commonConfig,
},
{
input: ['src/popup/index.ts'],
output: {
file: "dist/popup/index.js",
format: "esm",
},
...commonConfig,
},
{
input: ['src/options/index.ts'],
output: {
file: "dist/options/index.js",
format: "esm",
},
...commonConfig,
},
];