forked from robonyong/react-split-flap-display
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
49 lines (48 loc) · 1.32 KB
/
rollup.config.mjs
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
45
46
47
48
49
import path from 'path';
import url from '@rollup/plugin-url';
import copy from 'rollup-plugin-copy';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import license from 'rollup-plugin-license';
import pkg from './package.json' assert { type: 'json' };
export default [
{
strictDeprecations: true,
input: 'src/index.ts',
external: Object.keys(pkg.peerDependencies || {}),
plugins: [
typescript(),
url({
include: ['**/*.mp3'],
limit: 100000,
}),
copy({
targets: [
{ src: 'src/assets/**/*', dest: 'dist/assets/' },
{ src: 'src/assets/**/*', dest: 'example/src/ReactSplitFlapDisplay/assets' },
],
}),
nodeResolve(),
commonjs(),
license({
banner: {
content: {
file: './LICENSE',
},
},
}),
],
output: [
{ file: pkg.main, format: 'cjs', exports: 'named', sourcemap: false },
{ file: pkg.module, format: 'esm', exports: 'named', sourcemap: false },
{
file: 'example/src/ReactSplitFlapDisplay/index.js',
format: 'es',
exports: 'named',
banner: '/* eslint-disable */',
sourcemap: 'hidden',
},
],
},
];