forked from thumbmarkjs/thumbmarkjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
46 lines (43 loc) · 1.08 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
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/thumbmark.cjs.js',
format: 'cjs',
sourcemap: true,
},
{
file: 'dist/thumbmark.esm.js',
format: 'esm',
sourcemap: true,
},
{
file: 'dist/thumbmark.umd.js',
format: 'umd',
sourcemap: true,
name: 'ThumbmarkJS',
},
],
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/thumbmark.esm.d.ts", format: "es" }],
plugins: [dts()],
}
];
export default config;