-
Notifications
You must be signed in to change notification settings - Fork 366
/
rollup.config.js
40 lines (39 loc) · 1.19 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
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import globals from 'rollup-plugin-node-globals';
import pkg from './package.json';
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import { babelConfig } from './babel.config.json';
export default [
// browser-friendly UMD build
{
input: 'src/index.js',
output: {
name: 'strophe',
file: pkg.browser,
format: 'umd',
},
plugins: [babel(babelConfig), resolve(), commonjs(), globals()],
},
// Minified UMD build
{
input: 'src/index.js',
output: {
name: 'strophe',
file: 'dist/strophe.umd.min.js',
format: 'umd',
},
plugins: [babel(babelConfig), resolve(), commonjs(), globals(), terser()],
},
// CommonJS (for Node) and ES module (for bundlers) build.
{
input: 'src/index.js',
external: ['window'],
output: [
{ file: 'dist/strophe.common.js', format: 'cjs' },
{ file: pkg.module, format: 'es' },
],
plugins: [babel(babelConfig), globals()],
},
];