-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
45 lines (41 loc) · 1.14 KB
/
Copy pathrollup.config.mjs
File metadata and controls
45 lines (41 loc) · 1.14 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
import typescript from '@rollup/plugin-typescript';
import replace from '@rollup/plugin-replace';
import { readFileSync } from 'node:fs';
const { version } = JSON.parse(
readFileSync(new URL('./package.json', import.meta.url), 'utf8')
);
const banner = `//
// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
//`;
const plugins = (target) => [
replace({ preventAssignment: true, values: { __VERSION__: version } }),
typescript({ target, noEmitOnError: true }),
];
export default [
{
input: 'combinatorics.ts',
plugins: plugins('es2020'),
output: { file: 'combinatorics.js', format: 'es', banner },
},
{
input: 'combinatorics.ts',
plugins: plugins('es2020'),
output: {
file: 'commonjs/combinatorics.js',
format: 'cjs',
exports: 'named',
banner,
},
},
{
input: 'combinatorics.ts',
plugins: plugins('es2020'),
output: {
file: 'umd/combinatorics.js',
format: 'umd',
name: 'Combinatorics',
exports: 'named',
banner,
},
},
];