-
Notifications
You must be signed in to change notification settings - Fork 31
/
rollup.config.js
54 lines (53 loc) · 1.29 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
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import typescript from 'rollup-plugin-typescript';
import json from 'rollup-plugin-json';
import nodeBuiltIns from 'rollup-plugin-node-builtins';
import nodeGlobals from 'rollup-plugin-node-globals';
import uglify from 'rollup-plugin-uglify';
import babel from 'rollup-plugin-babel';
export default {
input: './src/index.ts',
plugins: [
json(),
nodeResolve({
jsnext: true,
main: true,
preferBuiltins: false,
}),
commonjs(),
nodeBuiltIns(),
nodeGlobals(),
typescript({
typescript: require('typescript'),
}),
babel({
plugins: ['babel-plugin-transform-custom-element-classes'],
babelrc: false,
exclude: 'node_modules/core-js/**',
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
browsers: ['> 1%', 'Chrome 41', 'not IE 11'],
},
useBuiltIns: 'usage',
},
],
],
runtimeHelpers: true,
}),
process.env.NODE_ENV === 'production' ? uglify() : {},
],
output: {
file: './dist/talkie.js',
format: 'umd',
name: 'talkie',
sourcemap: true,
},
watch: {
clearScreen: false,
},
};