-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
rollup.config.mjs
47 lines (44 loc) · 1.09 KB
/
rollup.config.mjs
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
import dts from 'rollup-plugin-dts'
import json from '@rollup/plugin-json'
// rollup.config.mjs
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript'
const config = [
{
input: 'src/index.ts', // replace with your entry file
output: [
{
file: 'dist/visitdata.cjs.js',
format: 'cjs',
sourcemap: true,
},
{
file: 'dist/visitdata.esm.js',
format: 'esm',
sourcemap: true,
},
{
file: 'dist/visitdata.umd.js',
format: 'umd',
sourcemap: true,
name: 'visitData',
},
],
plugins: [
resolve(), // so Rollup can find `ms`
commonjs(), // so Rollup can convert `ms` to an ES module
typescript(),
json(),
terser() // minify, but only in production
]
},
{
input: "./dist/types/index.d.ts",
output: [{ file: "./dist/visitdata.esm.d.ts", format: "es" }],
plugins: [dts()],
}
]
;
export default config;