-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
34 lines (33 loc) · 922 Bytes
/
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
import babel from '@rollup/plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
export default {
input: ['index.js', 'worker.js'],
plugins: [
resolve(),
babel({
babelHelpers: 'bundled',
presets: [
['@babel/preset-env', { targets: { node: 'current' }, modules: false }],
],
}),
terser(),
],
output: [
{
dir: 'dist/esm',
format: 'es',
assetFileNames: '[name].[ext]'
},
{
dir: 'dist/cjs',
format: 'cjs',
assetFileNames: '[name].[ext]'
},
// {
// file: 'dist/esm/index.min.js',
// format: 'es',
// },
],
external: ['mongodb', 'worker_threads', 'url', 'path', 'mongodb/lib/bson'], // Add other external dependencies
};