forked from TxnLab/use-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (44 loc) · 1.06 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
const resolve = require('@rollup/plugin-node-resolve').default
const commonjs = require('@rollup/plugin-commonjs').default
const typescript = require('rollup-plugin-typescript2')
const postcss = require('rollup-plugin-postcss')
const analyze = require('rollup-plugin-analyzer').default
const dts = require('rollup-plugin-dts').default
const pkg = require('./package.json')
module.exports = [
{
input: {
index: 'src/index.ts'
},
output: [
{
dir: 'dist/cjs',
format: 'cjs',
sourcemap: true
},
{
format: 'esm',
exports: 'named',
dir: 'dist/esm'
}
],
external: [...Object.keys(pkg.peerDependencies), ...Object.keys(pkg.devDependencies)],
plugins: [
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
tsconfigOverride: {
exclude: ['./src/components/*']
}
}),
postcss(),
analyze()
]
},
{
input: 'src/index.ts',
output: [{ file: 'dist/index.d.ts', format: 'es' }],
plugins: [dts()]
}
]