-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
46 lines (44 loc) · 1.33 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
import babel from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-typescript2';
const plugins = [
typescript(),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
extensions: ['.ts'],
presets: ['@babel/preset-env'],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions',
'@babel/plugin-transform-object-assign',
],
}),
];
export default [
{
input: './src/wave.ts',
output: [
{ file: './dist/wave.js', format: 'esm' },
{ file: './dist/wave.common.js', format: 'cjs' },
],
plugins,
external: ['laravel-echo', '@qruto/fetch-event-source'],
},
{
input: './src/index.iife.ts',
output: [{
file: './dist/wave.iife.js',
format: 'iife',
name: 'Wave',
globals: {
'@qruto/fetch-event-source': 'fetchEventSource',
'laravel-echo': 'Echo',
},
}],
plugins,
external: ['laravel-echo', '@qruto/fetch-event-source'],
},
];