-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
33 lines (30 loc) · 884 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
// @ts-check
import { defineConfig } from 'rollup'
import pkg from './package.json'
import esbuild from 'rollup-plugin-esbuild'
// banner
const banner = `/*!
* ${pkg.name} v${pkg.version} (${pkg.homepage})
* Copyright ${new Date().getFullYear()} ${pkg.author}
* Licensed under ${pkg.license} (${pkg.repository.replace('.git', '')}/blob/master/LICENSE)
*/`
// global variable name
const name = 'InputTouchspin'
export default defineConfig([
{
input: pkg.source,
output: [
{ banner, format: 'umd', file: pkg.main, name },
{ banner, format: 'es', file: pkg.module },
],
plugins: [esbuild({ target: 'esnext' })],
},
{
input: pkg.source,
output: [
{ banner, format: 'umd', file: pkg.main.slice(0, -2) + 'min.js', name },
{ banner, format: 'es', file: pkg.module.slice(0, -2) + 'min.js' },
],
plugins: [esbuild({ target: 'esnext', minify: true })],
},
])