forked from paveloom-t/gnome-shell-memento-mori
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
85 lines (80 loc) · 2.22 KB
/
rollup.config.js
File metadata and controls
85 lines (80 loc) · 2.22 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import cleanup from "rollup-plugin-cleanup";
import copy from "rollup-plugin-copy";
import typescript from "@rollup/plugin-typescript";
import { nodeResolve } from "@rollup/plugin-node-resolve";
const buildPath = "dist";
const globals = {
"@gi-types/adw1": "imports.gi.Adw",
"@gi-types/clutter10": "imports.gi.Clutter",
"@gi-types/gio2": "imports.gi.Gio",
"@gi-types/glib2": "imports.gi.GLib",
"@gi-types/glib2": "imports.gi.GLib",
"@gi-types/gobject2": "imports.gi.GObject",
"@gi-types/gtk4": "imports.gi.Gtk",
"@gi-types/st1": "imports.gi.St",
};
const external = Object.keys(globals);
const prefsFooter = [
"var init = prefs.init;",
"var fillPreferencesWindow = prefs.fillPreferencesWindow;",
].join("\n");
export default [
{
input: "src/extension.ts",
treeshake: {
moduleSideEffects: "no-external",
},
output: {
file: `${buildPath}/extension.js`,
name: "init",
format: "iife",
exports: "default",
globals,
assetFileNames: "[name][extname]",
},
external,
plugins: [
nodeResolve({
preferBuiltins: false,
}),
typescript({
tsconfig: "./tsconfig.json",
}),
copy({
targets: [
{ src: "./resources/metadata.json", dest: `${buildPath}` },
{ src: "./resources/schemas", dest: `${buildPath}` },
],
}),
cleanup({
comments: "none",
}),
],
},
{
input: "src/prefs.ts",
treeshake: {
moduleSideEffects: "no-external",
},
output: {
file: `${buildPath}/prefs.js`,
name: "prefs",
format: "iife",
exports: "default",
footer: prefsFooter,
globals,
},
external,
plugins: [
nodeResolve({
preferBuiltins: false,
}),
typescript({
tsconfig: "./tsconfig.json",
}),
cleanup({
comments: "none",
}),
],
},
];