-
Notifications
You must be signed in to change notification settings - Fork 30
/
rollup.webexcalling-config.js
62 lines (59 loc) · 1.55 KB
/
rollup.webexcalling-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
58
59
60
61
62
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import dts from 'rollup-plugin-dts';
import { terser } from 'rollup-plugin-terser';
const packageJson = require('./src/webexcalling/package.json');
const moduleName = packageJson.name.replace('@', '').replace('/', '-');
export default [
{
input: packageJson.source,
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
name: moduleName,
globals: { rxjs: 'rxjs' },
},
{
file: `${packageJson.main.slice(0, -3)}.min.js`,
format: 'cjs',
sourcemap: true,
plugins: [terser()],
globals: { rxjs: 'rxjs' },
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true,
globals: { rxjs: 'rxjs' },
},
{
file: `${packageJson.module.slice(0, -3)}.min.js`,
format: 'esm',
sourcemap: true,
plugins: [terser()],
globals: { rxjs: 'rxjs' },
},
],
external: [/rxjs/],
plugins: [
external(),
resolve(),
commonjs(),
typescript({
tsconfig: './src/webexcalling/tsconfig.json',
declarationDir: '.',
outputToFilesystem: true,
}),
],
},
{
input: 'dist/esm/src/index.d.ts',
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
external: [/\.css$/, /\.scss$/],
plugins: [dts()],
},
];