-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
rollup.config.js
49 lines (48 loc) · 1.15 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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import del from 'rollup-plugin-delete';
import terser from '@rollup/plugin-terser';
export default {
input: './dist/tsc/index.js', // Change to compiled JavaScript from tsc
output: [
{
dir: './dist/esm',
format: 'esm',
interop: 'esModule',
sourcemap: true,
preserveModules: false,
entryFileNames: '[name].mjs',
},
{
dir: './dist/esm/min',
format: 'esm',
interop: 'esModule',
plugins: [terser()],
sourcemap: true,
entryFileNames: '[name].min.mjs',
},
{
dir: './dist/cjs',
format: 'cjs',
sourcemap: false,
exports: 'auto',
entryFileNames: '[name].js',
},
{
dir: './dist/cjs/min',
format: 'cjs',
plugins: [terser()],
sourcemap: true,
exports: 'auto',
entryFileNames: '[name].min.js',
},
],
plugins: [
del({ targets: ['./dist/esm/*', './dist/cjs/*'] }),
resolve(),
commonjs(),
json(),
],
external: ['puppeteer', 'cheerio', 'jsdom', 'winston'],
};