This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
executable file
·65 lines (64 loc) · 1.72 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
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
import dts from 'rollup-plugin-dts';
import pkg from './package.json';
export default [
{
input: './src/index.ts',
output: [
// browser-friendly UMD build
{
file: `./dist/${pkg.name}.umd.js`,
format: 'umd',
exports: 'named',
name: pkg.name,
},
// browser-friendly UMD build (minified)
{
file: `./dist/${pkg.name}.umd.min.js`,
format: 'umd',
exports: 'named',
name: pkg.name,
},
// ES module
{
file: `./dist/${pkg.name}.js`,
format: 'es',
},
// ES module (minified)
{
file: `./dist/${pkg.name}.min.js`,
format: 'es',
},
],
external: [], // Object.keys(pkg.dependencies),
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: {
declaration: false,
module: 'es2015',
},
},
}),
terser({
include: [ /^.+\.min\.js$/ ],
}),
sizeSnapshot(),
],
},
{
input: './dist/npm/index.d.ts',
output: [
// ES module
{
file: `./dist/${pkg.name}.d.ts`,
format: 'es',
},
],
plugins: [
dts(),
],
},
];