-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
44 lines (42 loc) · 1.06 KB
/
Copy pathrollup.config.js
File metadata and controls
44 lines (42 loc) · 1.06 KB
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
37
38
39
40
41
42
43
44
import babel from '@rollup/plugin-babel';
import commonJs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import dts from 'rollup-plugin-dts';
const packageJson = require('./package.json');
const extensions = ['.js', '.jsx', '.ts', '.tsx'];
const banner = `
/*!
* react-virtual-sortable v${packageJson.version}
* open source under the MIT license
* ${packageJson.homepage}
*/
`;
export default [
{
input: 'src/index.tsx',
output: [
{
format: 'es',
file: packageJson.module,
banner: banner.replace(/\n/, ''),
},
{
format: 'cjs',
file: packageJson.main,
exports: 'default',
banner: banner.replace(/\n/, ''),
},
],
external: ['react', 'sortable-dnd'],
plugins: [resolve(), typescript(), commonJs(), babel({ extensions, babelHelpers: 'bundled' })],
},
{
input: 'src/index.tsx',
output: {
file: 'types/index.d.ts',
format: 'esm',
},
plugins: [dts()],
},
];