-
Notifications
You must be signed in to change notification settings - Fork 129
/
rollup.config.js
38 lines (35 loc) · 980 Bytes
/
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
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import sizeCheck from 'rollup-plugin-filesize-check'
import { version } from './package.json'
console.log('\n 📦 - running rollup..\n')
const name = 'wtf-plugin-html'
const banner = `/* ${name} ${version} MIT */`
export default [
// === es-module ===
{
input: 'src/index.js',
output: [{ banner: banner, file: `builds/${name}.mjs`, format: 'esm' }],
plugins: [
commonjs(),
]
},
// === .js ===
{
input: 'src/index.js',
output: [{ banner: banner, file: `builds/${name}.cjs`, format: 'umd', name: 'wtfHtml', sourcemap: false }],
plugins: [
commonjs(),
]
},
// === min.js ===
{
input: 'src/index.js',
output: [{ banner: banner, file: `builds/${name}.min.js`, format: 'umd', name: 'wtfHtml', sourcemap: false }],
plugins: [
commonjs(),
terser(),
sizeCheck({ expect: 10, warn: 10 })
]
}
]