forked from joeattardi/picmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
55 lines (53 loc) · 1.24 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
import typescript from '@rollup/plugin-typescript';
import { string } from 'rollup-plugin-string';
import postcss from 'rollup-plugin-postcss';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
const bundles = [
{
input: 'src/umd/picmo.ts',
output: {
sourcemap: true,
file: 'dist/umd/picmo.js',
format: 'umd',
name: 'picmo'
}
},
{
input: 'src/umd/picmo.twemoji.ts',
output: {
sourcemap: true,
file: 'dist/umd/picmo.twemoji.js',
format: 'umd',
name: 'TwemojiRenderer'
}
},
{
input: {
'index': './src/index.ts',
'renderers/native': './src/renderers/native.ts',
'renderers/twemoji': './src/renderers/twemoji.ts',
'themes': './src/themes.ts',
'i18n/en': './src/i18n/lang-en.ts'
},
output: {
dir: 'dist',
format: 'es'
}
}
];
export default bundles.map(bundle => ({
...bundle,
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
preventAssignment: true
}),
nodeResolve(),
string({ include: ['**/*.svg']}),
typescript(),
postcss({ modules: true }),
terser()
]
}));