-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrollup.config.prod.js
43 lines (39 loc) · 1.03 KB
/
rollup.config.prod.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
import babel from '@rollup/plugin-babel'
import terser from '@rollup/plugin-terser'
import cleanup from 'rollup-plugin-cleanup'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const pkg = require('./package.json')
const banner = `/*! Color-Picker ${pkg.version} MIT | https://github.com/yairEO/color-picker */`
export default [
{
input: 'src/color-picker.js',
output: [
{
banner,
file: pkg.main,
format: 'es',
name: 'ColorPicker',
exports: 'named',
sourcemap: true,
},
{
banner,
file: pkg.main.replace('.es.', '.iife.'),
format: 'iife',
name: 'colorPicker',
exports: 'named',
sourcemap: true,
}
],
plugins: [
terser(),
babel({ babelHelpers: 'bundled' }),
cleanup(),
nodeResolve(),
commonjs()
]
}
]