-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
37 lines (34 loc) · 952 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
35
36
37
import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve'
import { terser } from 'rollup-plugin-terser'
import commonjs from '@rollup/plugin-commonjs'
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const onwarn = (warning, warn) => {
// Silence circular dependency warning for node_modules package
if (warning.code === 'CIRCULAR_DEPENDENCY' && warning.importer.startsWith('node_modules')) {
return
}
warn(warning)
}
export default {
input: 'src/index.ts',
onwarn,
plugins: [
commonjs(),
resolve({
preferBuiltins: true
}),
typescript({
tsconfig: './tsconfig.json',
sourceMap: true,
exclude: ['**/__tests__/**/*', '**/__mocks__/**/*', '**/?(*.)+(spec|test).+(ts|tsx|js)']
}),
terser()
],
output: {
dir: 'dist',
format: 'cjs',
sourcemap: true
},
external: ['glob', 'webpack', 'path', 'fs']
}