-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
49 lines (46 loc) · 1022 Bytes
/
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
import { uglify } from 'rollup-plugin-uglify';
import clear from 'rollup-plugin-clear';
import filesize from 'rollup-plugin-filesize';
import license from 'rollup-plugin-license';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import cleanup from 'rollup-plugin-cleanup';
const banner = `/*!
* Smarkdown v${pkg.version}
* (c) 2018-present ${pkg.author}
* Released under the ${pkg.license} License.
*/`;
const input = 'src/index.ts';
const sharedPlugins = [
typescript(),
license({
banner
})
];
const commonConfig = { input };
export default [
{
...commonConfig,
output: {
name: 'Smarkdown',
file: pkg.browser,
format: 'umd'
},
plugins: [
...sharedPlugins,
clear({
targets: ['dist']
}),
uglify(),
filesize()
]
},
{
...commonConfig,
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
],
plugins: [...sharedPlugins, cleanup()]
}
];