-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrollup.config.js
More file actions
50 lines (48 loc) · 1.19 KB
/
rollup.config.js
File metadata and controls
50 lines (48 loc) · 1.19 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
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import path from 'path';
import fs from 'fs';
import * as meta from './package.json';
var license = fs.readFileSync(path.join(__dirname, 'LICENSE'), 'utf-8');
var banner = '/**\n *\n' + license.split('\n').map(function (line) {
return ' *' + (line.length ? ' ' : '') + line;
}).join('\n') + '\n */';
var copyright = license.split('\n').filter(function (line) {
return /Copyright/.test(line);
}).join(', ');
export default [
{
input: 'src/index.ts',
output: [
{
file: 'dist/timeweb.js',
name: 'timeweb',
banner,
format: 'umd'
},
{
file: 'dist/timeweb.min.js',
name: 'timeweb',
plugins: [ terser({
format: { preamble: '// timeweb v' + meta.version + ' ' + copyright }
}) ],
format: 'umd'
},
{
file: 'dist/timeweb.module.js',
banner,
format: 'es'
}
],
plugins: [
typescript({
compilerOptions: {
resolveJsonModule: true,
target: 'es2015'
}
}),
json()
]
}
];