-
Notifications
You must be signed in to change notification settings - Fork 183
/
rollup.config.js
36 lines (34 loc) · 1.02 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
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/echo.ts',
output: [
{ file: './dist/echo.js', format: 'esm' },
{ file: './dist/echo.common.js', format: 'cjs' },
],
plugins,
},
{
input: './src/index.iife.ts',
output: [{ file: './dist/echo.iife.js', format: 'iife', name: 'Echo' }],
plugins,
},
];