-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.base.js
More file actions
33 lines (31 loc) · 759 Bytes
/
rollup.base.js
File metadata and controls
33 lines (31 loc) · 759 Bytes
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
import babel from 'rollup-plugin-babel';
import localResolve from 'rollup-plugin-node-resolve';
import path from 'path';
const pkg = require(path.resolve('./package.json'));
const external = Object.keys(pkg.dependencies || {}).concat(Object.keys(pkg.peerDependencies || {}));
const name = pkg.name.split('/')[1];
export default {
input: 'src/index.ts',
output: [
{
file: `dist/es/${name}.js`,
format: 'es',
exports: 'named',
},
{
file: `dist/cjs/${name}.js`,
format: 'cjs',
exports: 'named',
},
],
plugins: [
localResolve({
extensions: [ '.js', '.ts', '.tsx' ],
}),
babel({
exclude: 'node_modules/**',
extensions: [ '.js', '.ts', '.tsx' ],
}),
],
external,
};