-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
109 lines (108 loc) · 1.88 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import analyze from 'rollup-plugin-analyzer';
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import pkg from './package.json';
import terser from '@rollup/plugin-terser';
export default [
// UMD
{
input: 'src/index.ts',
output: {
name: '@do-kevin/pc-vn',
file: pkg.browser,
format: 'umd',
},
plugins: [
json({
compact: true,
}),
typescript(),
resolve(),
commonjs(),
terser(),
analyze(),
],
},
// CommonJS & ES Module
{
input: 'src/index.ts',
external: ['ms'],
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' },
],
plugins: [
json({
compact: true,
}),
typescript(),
terser(),
analyze(),
],
},
{
input: 'src/district.ts',
output: [
{
file: 'dist/district.js',
format: 'cjs',
},
{
file: 'dist/es/district.js',
format: 'es',
},
],
plugins: [
json({
compact: true,
}),
terser(),
typescript(),
analyze(),
],
},
{
input: 'src/ward.ts',
output: [
{
file: 'dist/ward.js',
format: 'cjs',
},
{
file: 'dist/es/ward.js',
format: 'es',
},
],
plugins: [
json({
compact: true,
}),
typescript(),
terser(),
analyze(),
],
},
{
input: 'src/province.ts',
output: [
{
file: 'dist/province.js',
format: 'cjs',
},
{
file: 'dist/es/province.js',
format: 'es',
},
],
plugins: [
json({
compact: true,
}),
typescript(),
terser(),
analyze(),
],
},
];