-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathrollup.config.js
57 lines (55 loc) · 1.28 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import buble from '@rollup/plugin-buble';
import replace from '@rollup/plugin-replace';
import cleanup from 'rollup-plugin-cleanup';
import sourcemaps from 'rollup-plugin-sourcemaps';
import { terser } from 'rollup-plugin-terser';
import copy from 'rollup-plugin-copy';
import pkg from './package.json';
export default [
{
input: 'src/index.js',
output: {
file: pkg.browser,
format: 'umd',
name: 'Values'
},
plugins: [
resolve({ dedupe: ['parse-css-color'] }),
commonjs(),
buble(),
cleanup(),
replace({ __VERSION__: `v${pkg.version}` }),
terser(),
copy({
targets: [
{
src: 'src/index.d.ts',
dest: 'dist'
}
]
})
]
},
{
input: 'src/index.js',
external: [
'mix-css-color',
'parse-css-color',
'pure-color/convert/hsl2rgb',
'pure-color/convert/rgb2hex'
],
plugins: [
sourcemaps(),
resolve(),
commonjs(),
cleanup(),
replace({ __VERSION__: `v${pkg.version}` })
],
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'es' }
]
}
];