forked from epsagon/epsagon-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 1.08 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
import copy from 'rollup-plugin-copy';
const commonjs = require('rollup-plugin-commonjs');
const { eslint } = require('rollup-plugin-eslint');
const { terser } = require('rollup-plugin-terser');
const json = require('rollup-plugin-json');
module.exports = {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'cjs',
},
plugins: [
(process.env.NODE_ENV === 'production' ? eslint({
throwOnError: true,
throwOnWarning: true,
}) : null),
commonjs({
ignore: ['conditional-runtime-dependency'],
}),
json(),
(process.env.NODE_ENV === 'production' ? terser({
warnings: 'verbose',
compress: {
warnings: 'verbose',
},
mangle: {
keep_fnames: true,
},
output: {
beautify: false,
},
}) : null),
copy({
targets: [{
src: 'src/index.d.ts', dest: 'dist', rename: 'bundle.d.ts',
}],
}),
],
};