-
Notifications
You must be signed in to change notification settings - Fork 7
/
rollup.components.mjs
45 lines (36 loc) · 1.17 KB
/
rollup.components.mjs
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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';
import svg from 'rollup-plugin-svg-import';
import copy from 'rollup-plugin-copy';
export default {
input: 'temba-components.ts',
output: {
file: 'dist/temba-components.js',
// Immediately Invoked Function Expression
format: 'iife',
name: 'TembaComponents',
sourcemap: true
},
plugins: [
// inline our icons
svg({ stringify: true }),
// resolve external modules
resolve(),
// convert commonjs modules to es6
commonjs({ include: 'node_modules/**' }),
// compile our typescript
typescript({ sourceMap: true, inlineSources: true }),
copy({
targets: [
{ src: 'static/svg/index.svg', dest: 'dist/static/svg/' },
{ src: 'static/img', dest: 'dist/static/' },
{ src: 'out-tsc/src/locales', dest: 'dist/' },
],
hook: 'writeBundle',
}),
// minify
terser()
]
};