Skip to content

Commit ea9ab70

Browse files
committed
Create rollup.config.js
1 parent c751946 commit ea9ab70

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

rollup.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import typescript from 'rollup-plugin-typescript2';
2+
import { createRequire } from 'module';
3+
4+
const require = createRequire(import.meta.url);
5+
const pkg = require('./package.json');
6+
7+
export default {
8+
input: 'src/index.ts',
9+
output: [
10+
{
11+
file: pkg.main,
12+
format: 'cjs',
13+
exports: 'named',
14+
sourcemap: true,
15+
},
16+
{
17+
file: pkg.module,
18+
format: 'esm',
19+
exports: 'named',
20+
sourcemap: true,
21+
},
22+
],
23+
external: [
24+
...Object.keys(pkg.peerDependencies || {}),
25+
'react',
26+
'react-dom',
27+
],
28+
plugins: [
29+
typescript({
30+
typescript: require('typescript'),
31+
clean: true,
32+
}),
33+
],
34+
};

0 commit comments

Comments
 (0)