-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
100 lines (98 loc) · 2.17 KB
/
rollup.config.ts
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
/* eslint-disable */
import typescript from 'rollup-plugin-typescript2'
import { terser, Options } from 'rollup-plugin-terser'
import resolve from '@rollup/plugin-node-resolve'
import postcss from 'rollup-plugin-postcss'
import dts from 'rollup-plugin-dts'
import { injectVueDemi, ingoreCss } from './scripts/rollup'
/** @type {import('rollup').RollupOptions} */
const options = [
{
input: 'src/index.ts',
plugins: [typescript(), postcss()],
external: ['vue-demi'],
output: [
{
file: 'dist/index.esm.js',
format: 'es',
sourcemap: true
},
{
file: 'dist/index.esm.min.js',
format: 'es',
sourcemap: true,
plugins: [
terser({
format: {
comments: false
}
} as Options)
]
},
{
file: 'dist/index.cjs.js',
format: 'cjs',
exports: 'named',
sourcemap: true
},
{
file: 'dist/index.cjs.min.js',
format: 'cjs',
exports: 'named',
sourcemap: true,
plugins: [
terser({
format: {
comments: false
}
} as Options)
]
}
]
},
{
input: 'src/global.ts',
plugins: [resolve(), typescript(), postcss()],
external: ['vue-demi', 'echarts', 'echarts/core'],
output: [
{
file: 'dist/index.umd.js',
format: 'umd',
name: 'EquityPenetrationChart',
exports: 'default',
sourcemap: true,
globals: {
'vue-demi': 'VueDemi'
},
plugins: [injectVueDemi]
},
{
file: 'dist/index.umd.min.js',
format: 'umd',
name: 'EquityPenetrationChart',
exports: 'default',
sourcemap: true,
globals: {
'vue-demi': 'VueDemi'
},
plugins: [
injectVueDemi,
terser({
format: {
comments: false
}
} as Options)
]
}
]
},
{
input: 'src/index.ts',
plugins: [ingoreCss, dts()],
output: {
file: 'dist/index.d.ts',
format: 'es'
}
}
]
export default options