forked from jvail/spl.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.node.js
39 lines (36 loc) · 946 Bytes
/
rollup.config.node.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
import { terser } from 'rollup-plugin-terser';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import copy from 'rollup-plugin-copy';
import json from '@rollup/plugin-json';
const ts = typescript({
useTsconfigDeclarationDir: true
});
const cp = copy({
targets: [
{ src: 'src/build/js/spl.wasm', dest: 'dist' },
{ src: 'src/build/bc/share/proj', dest: 'dist' },
{ src: 'src/spl.d.ts', dest: 'dist' }
]
});
export default args => ({
input: 'src/spl-node.ts',
output: [
{ file: 'dist/spl.js', format: 'cjs', preferConst: true, exports: 'auto'}
],
plugins: args.configDebug ? [
nodeResolve(),
json(),
ts,
commonjs(),
cp
] : [
nodeResolve(),
json(),
ts,
commonjs(),
terser(),
cp
]
});