-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrollup.config.js
57 lines (54 loc) · 1.31 KB
/
rollup.config.js
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
50
51
52
53
54
55
56
57
import sass from 'rollup-plugin-sass';
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import externalDeps from 'rollup-plugin-peer-deps-external';
import replace from '@rollup/plugin-replace';
// import pkg from './package.json';
const external = ['react', 'react-dom'];
const globals = {
react: 'React',
uuid: 'uuid',
'styled-components': 'styled',
};
export default [
{
input: 'src/index.tsx',
output: [
{
name: 'AnimatedText',
file: 'dist/react-animated-text-content.development.js',
format: 'umd',
exports: 'named',
sourcemap: true,
strict: false,
compact: true,
globals,
},
],
plugins: [sass({ insert: true }), typescript()],
external,
},
{
input: 'src/index.tsx',
output: [
{
name: 'AnimatedText',
file: 'dist/react-animated-text-content.production.js',
format: 'umd',
exports: 'named',
sourcemap: true,
strict: true,
compact: true,
globals,
},
],
plugins: [
sass({ insert: true }),
typescript(),
replace({ 'process.env.NODE_ENV': `"production"`, delimiters: ['', ''] }),
externalDeps(),
terser(),
],
external: ['react', 'react-dom'],
},
];