-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrollup.config.js
32 lines (29 loc) · 897 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
import { defineConfig } from 'rollup'
import cleanup from 'rollup-plugin-cleanup'
import { terser } from 'rollup-plugin-terser'
import typescript from '@rollup/plugin-typescript'
import packageJson from './package.json' assert { type: 'json' }
const { name, version } = packageJson
const license = 'Licensed MIT @ Luan Eduardo da Costa'
const licenseBanner = `/* ${name} ${version} - ${license} */`
export default defineConfig({
input: 'src/index.ts',
plugins: [typescript({ module: 'ESNext' }), cleanup({ comments: 'none' })],
output: [
{
format: 'esm',
file: 'dist/index.js',
},
{
format: 'cjs',
file: 'dist/index.common.js',
},
{
format: 'iife',
file: 'dist/index.browser.js',
name: 'CopyImageClipboard',
banner: licenseBanner,
plugins: [terser({ format: { comments: new RegExp(name, 'g') } })],
},
],
})