-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
39 lines (35 loc) · 909 Bytes
/
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
/* eslint-disable @typescript-eslint/no-var-requires */
const typescript = require('@rollup/plugin-typescript');
const terser = require('@rollup/plugin-terser');
const replace = require('@rollup/plugin-replace');
const packageVersion = require('./package').version;
const baseConfigs = {
input: 'src/index.ts',
output: {
file: 'dist/index.js',
format: 'umd',
name: 'EsportsNotifier'
}
};
const basePlugins = [
replace({
__ROLL_UP_REPLACE_BUILD_TIME__: new Date().toLocaleString('pt-BR', { timeZone: 'America/Belem' }).replace(', ', ' '),
__ROLL_UP_REPLACE_BUILD_VERSION__: packageVersion,
preventAssignment: true
}),
typescript()
];
module.exports = [
{
...baseConfigs,
plugins: basePlugins
},
{
input: baseConfigs.input,
output: {
...baseConfigs.output,
file: 'dist/index.min.js'
},
plugins: [...basePlugins, terser()]
}
];