forked from tungv/event-context
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
28 lines (25 loc) · 869 Bytes
/
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
import buble from 'rollup-plugin-buble';
import strip from 'rollup-plugin-strip';
const capitalize = str => str[0].toUpperCase() + str.slice(1);
const plugin = process.env.BUILD_PLUGIN;
const entry = plugin ? `src/plugins/${plugin}/index.js` : 'src/index.js';
const moduleName = plugin ? `EventContextPlugin${capitalize(plugin)}` : 'EventContext';
const dest = plugin ? `build/plugins-${plugin}` : 'build/core';
export default {
moduleName,
entry,
targets: [
{ dest: `${dest}/index.js`, format: 'cjs' },
{ dest: `${dest}/index.es.js`, format: 'es' },
{ dest: `${dest}/dist/index.js`, format: 'umd' },
],
format: 'iife',
plugins: [buble(), strip({
debugger: true,
// defaults to `[ 'console.*', 'assert.*' ]`
functions: [ 'console.*', 'assert.*', 'debug', 'alert' ],
})],
globals: {
'event-context': 'EventContext',
}
};