-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
34 lines (32 loc) · 878 Bytes
/
rollup.config.js
File metadata and controls
34 lines (32 loc) · 878 Bytes
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
import terser from '@rollup/plugin-terser';
import css from 'rollup-plugin-css-only';
const production = !process.env.ROLLUP_WATCH;
export default [
// ESM build
{
input: 'src/index.js',
output: {
file: 'dist/pendo-guide-components.esm.js',
format: 'esm',
sourcemap: true
},
plugins: [
css({ output: 'pendo-guide-components.css' }),
production && terser()
]
},
// IIFE build for CDN/script tag usage
{
input: 'src/index.js',
output: {
file: 'dist/pendo-guide-components.js',
format: 'iife',
name: 'PendoGuideComponents',
sourcemap: true
},
plugins: [
css({ output: false }), // CSS already output by ESM build
production && terser()
]
}
];