-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
51 lines (49 loc) · 1.25 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
50
51
const { minify } = require('rollup-plugin-esbuild')
const typescript = require('@rollup/plugin-typescript')
const commonjs = require('@rollup/plugin-commonjs')
const nodeResolve = require('@rollup/plugin-node-resolve')
const lib = require('./package.json')
/**
* @type {import('rollup').RollupOptions}
*/
module.exports = () => {
const year = new Date().getFullYear()
const banner = `// Ofx-data-extractor v${lib.version} Copyright (c) ${year} ${lib.author}`
return [
{
input: 'src/index.ts',
treeshake: true,
plugins: [
typescript({ declaration: false }),
commonjs(),
nodeResolve(),
minify({
keepNames: false,
treeShaking: true,
minify: true,
banner,
globalName: 'ofx',
}),
],
output: [
{
file: 'dist/umd/bundle.min.js',
format: 'umd',
name: 'ofx',
},
{
file: 'dist/esm/index.min.js',
format: 'esm',
},
],
},
{
input: 'src/index.ts',
plugins: [typescript({ tsconfig: './tsconfig.json' })],
output: {
file: 'dist/index.d.ts',
format: 'esm',
},
},
]
}