forked from KittyGiraudel/a11y-dialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
55 lines (51 loc) · 1.08 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
52
53
54
55
import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const plugins = [nodeResolve(), typescript({ tsconfig: './tsconfig.json' })]
const minify = terser({
format: {
preamble: `/*! a11y-dialog ${pkg.version} — © Kitty Giraudel */`,
},
})
const umdCfg = {
format: 'umd',
name: 'A11yDialog',
exports: 'default',
}
export default [
{
input: 'src/a11y-dialog.ts',
plugins: plugins,
output: [
{
...umdCfg,
file: 'dist/a11y-dialog.js',
},
{
...umdCfg,
file: 'dist/a11y-dialog.min.js',
plugins: [minify],
},
{
...umdCfg,
file: 'cypress/fixtures/a11y-dialog.js',
},
],
},
{
input: 'src/a11y-dialog.ts',
plugins: plugins,
output: [
{
file: 'dist/a11y-dialog.esm.js',
format: 'esm',
},
{
file: 'dist/a11y-dialog.esm.min.js',
format: 'esm',
plugins: [minify],
},
],
},
]