generated from hhenrichsen/motion-canvas-component-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
40 lines (37 loc) · 996 Bytes
/
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
import typescript from '@rollup/plugin-typescript';
import dts from 'rollup-plugin-dts';
import externals from 'rollup-plugin-node-externals';
import terser from '@rollup/plugin-terser';
// eslint-disable-next-line no-undef
const minify = process.env.MINIFY == '1';
/** @type {import('rollup').RollupOptions} */
const config = [
{
input: 'src/index.ts',
output: {
file: 'lib/bundle.js',
format: 'umd',
name: 'MotionCanvasTerminalComponent',
},
plugins: [externals(), typescript(), minify && terser()],
external: [/^@motion-canvas\/core/, /^@motion-canvas\/2d/],
},
{
input: 'src/index.ts',
output: {
file: 'lib/index.js',
format: 'es',
},
plugins: [externals(), typescript(), minify && terser()],
external: [/^@motion-canvas\/core/, /^@motion-canvas\/2d/],
},
{
input: 'src/index.ts',
output: {
file: 'lib/index.d.ts',
format: 'es',
},
plugins: [dts()],
},
];
export default config;