-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathrollup-esm.config.js
35 lines (33 loc) · 1008 Bytes
/
rollup-esm.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
import babel from '@rollup/plugin-babel';
import ts from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default [
{
input: 'src/index.ts',
output: [
{
file: 'dist/index.esm.js',
format: 'esm', // ES2015 modules version so consumers can tree-shake
},
],
plugins: [
nodeResolve(),
ts({
declarationDir: 'dist/types',
rootDir: 'src',
outDir: 'dist',
module: 'ESNext',
target: 'ESNext',
moduleResolution: 'Node',
esModuleInterop: true,
}),
json(),
babel({
babelHelpers: 'bundled',
plugins: ['@babel/plugin-proposal-class-properties'],
presets: ['@babel/preset-typescript'],
}),
],
},
];