-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.ts
40 lines (39 loc) · 964 Bytes
/
rollup.config.ts
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 resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
import typescript from 'rollup-plugin-typescript2';
import json from '@rollup/plugin-json';
import { terser } from 'rollup-plugin-terser';
import pkg from './package.json';
export default {
input: `src/main.ts`,
output: [
{
file: pkg.main,
name: pkg.name,
format: 'umd',
sourcemap: true,
globals: {
axios: 'axios',
buffer: 'buffer',
'hash-wasm': 'hashWasm',
'crypto-js/aes': 'cryptoAes',
},
},
{ file: pkg.module, format: 'es', sourcemap: true },
],
external: ['crypto-js/aes', 'hash-wasm', 'axios'],
watch: {
include: 'src/**',
},
plugins: [
json(),
typescript({ useTsconfigDeclarationDir: true }),
commonjs(),
resolve({
preferBuiltins: false,
}),
terser(),
sourceMaps(),
],
};