1 | import babel from '@rollup/plugin-babel';
|
2 | import typescript from 'rollup-plugin-typescript2';
|
3 |
|
4 | const plugins = [
|
5 | typescript(),
|
6 | babel({
|
7 | babelHelpers: 'bundled',
|
8 | exclude: 'node_modules/**',
|
9 | extensions: ['.ts'],
|
10 | presets: ['@babel/preset-env'],
|
11 | plugins: [
|
12 | ['@babel/plugin-proposal-decorators', { legacy: true }],
|
13 | '@babel/plugin-proposal-function-sent',
|
14 | '@babel/plugin-proposal-export-namespace-from',
|
15 | '@babel/plugin-proposal-numeric-separator',
|
16 | '@babel/plugin-proposal-throw-expressions',
|
17 | '@babel/plugin-transform-object-assign',
|
18 | ],
|
19 | }),
|
20 | ];
|
21 |
|
22 | export default [
|
23 | {
|
24 | input: './src/echo.ts',
|
25 | output: [
|
26 | { file: './dist/echo.js', format: 'esm' },
|
27 | { file: './dist/echo.common.js', format: 'cjs' },
|
28 | ],
|
29 | plugins,
|
30 | },
|
31 | {
|
32 | input: './src/index.iife.ts',
|
33 | output: [{ file: './dist/echo.iife.js', format: 'iife', name: 'Echo' }],
|
34 | plugins,
|
35 | },
|
36 | ];
|