forked from chanind/hanzi-writer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
58 lines (56 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
58
import { terser } from 'rollup-plugin-terser';
import ts from '@wessberg/rollup-plugin-ts';
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import pkg from './package.json';
import license from 'rollup-plugin-license';
import filesize from 'rollup-plugin-filesize';
const extensions = ['.js', '.ts'];
export default [
{
input: 'src/HanziWriter.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
file: 'dist/hanzi-writer.min.js',
format: 'iife',
name: 'HanziWriter',
sourcemap: true,
plugins: [terser()],
exports: 'default',
},
{
file: 'dist/hanzi-writer.js',
format: 'iife',
name: 'HanziWriter',
exports: 'default',
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
exports: 'default',
},
],
plugins: [
filesize(),
ts({
transpiler: 'babel',
}),
resolve({ extensions }),
babel({
exclude: 'node_modules/**',
extensions,
babelHelpers: 'bundled',
}),
license({
banner: `Hanzi Writer v<%= pkg.version %> | https://chanind.github.io/hanzi-writer`,
}),
],
},
];