-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup_test.config.js
executable file
·48 lines (42 loc) · 1.32 KB
/
rollup_test.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
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
const { terser } = require('rollup-plugin-terser');
const replace = require('@rollup/plugin-replace');
const ignore = require('rollup-plugin-ignore');
const pkg = require('./package.json');
require('dotenv').config();
const opts = {
__ENVIRONMENT__: JSON.stringify(require('dotenv').config().parsed),
__GH_TOKEN__: process.env.GH_TOKEN ?? '',
__MASTER_WEBHOOK__: process.env.MASTER_WEBHOOK ?? '',
__USERS_WEBHOOK__: process.env.USERS_WEBHOOK ?? '',
__PROXY_API_KEY__: process.env.PROXY_API_KEY ?? '',
__PROXY_API_URL__: process.env.PROXY_API_URL ?? '',
__PROXY_API_BOT_TOKEN__: process.env.PROXY_API_BOT_TOKEN ?? '',
__CONTROL_USERS_ROLE__: process.env.CONTROL_USERS_ROLE ?? '',
__DATE_PUBLISH__: new Date().getTime(),
__VERSION__: pkg.version,
};
module.exports = () => ({
input: './src/index.ts',
output: [
{
file: './dist/bundle.js',
format: 'umd',
},
],
plugins: [
ignore(['pylon-runtime.d.ts', 'pylon-runtime-discord.d.ts']),
replace(opts),
nodeResolve(),
typescript({ lib: ['es2020'], target: 'es2020' }),
terser(),
],
onwarn(warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
// Squelch.
return;
}
warn(warning);
},
});