This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
rollup.config.js
92 lines (86 loc) · 2.16 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
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
86
87
88
89
90
91
92
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import scss from 'rollup-plugin-scss';
import copy from 'rollup-plugin-copy';
const buildPath = 'dist';
const globals = {
'@imports/Gio-2.0': 'imports.gi.Gio',
'@imports/Gdk-3.0': 'imports.gi.Gdk',
'@imports/Gtk-3.0': 'imports.gi.Gtk',
'@imports/GdkPixbuf-2.0': 'imports.gi.GdkPixbuf',
'@imports/GLib-2.0': 'imports.gi.GLib',
'@imports/St-1.0': 'imports.gi.St',
'@imports/Shell-0.1': 'imports.gi.Shell',
'@imports/Meta-6': 'imports.gi.Meta',
'@imports/Wnck-3.0': 'imports.gi.Wnck',
'@imports/Clutter-6': 'imports.gi.Clutter',
'@imports/Soup-2.4': 'imports.gi.Soup',
};
const external = Object.keys(globals);
const banner = [
].join('\n');
const prefsFooter = [
'var init = prefs.init;',
'var buildPrefsWidget = prefs.buildPrefsWidget;',
].join('\n')
export default [
{
input: 'src/extension.ts',
output: {
file: `${buildPath}/extension.js`,
format: 'iife',
name: 'init',
banner,
exports: 'default',
globals,
},
external,
plugins: [
commonjs(),
nodeResolve({
preferBuiltins: false,
}),
typescript({
tsconfig: './tsconfig.json',
}),
scss({
output: `${buildPath}/stylesheet.css`,
failOnError: true,
watch: 'src/styles',
}),
copy({
targets: [
{ src: './resources/icons', dest: `${buildPath}` },
{ src: './resources/metadata.json', dest: `${buildPath}` },
{ src: './resources/schemas', dest: `${buildPath}` },
],
}),
],
},
{
input: 'src/prefs/prefs.ts',
output: {
file: `${buildPath}/prefs.js`,
format: 'iife',
exports: 'default',
name: 'prefs',
banner,
footer: prefsFooter,
globals,
},
external,
plugins: [
commonjs(),
nodeResolve({
preferBuiltins: false,
}),
typescript({
tsconfig: './tsconfig.json',
}),
copy({
targets: [{ src: './resources/ui', dest: `${buildPath}` }],
}),
],
},
];