-
Notifications
You must be signed in to change notification settings - Fork 8
/
rollup.config.dev.js
39 lines (36 loc) · 1.01 KB
/
rollup.config.dev.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 cleanup from 'rollup-plugin-cleanup'
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'
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')
export default [
{
input: 'src/color-picker.js',
output: [
{
file: pkg.main,
format: 'es',
exports: 'named',
name: 'ColorPicker',
sourcemap: true,
},
{
file: pkg.main.replace('.es.', '.iife.'),
format: 'iife',
exports: 'named',
name: 'colorPicker',
sourcemap: true,
}
],
plugins: [
serve({port: 10011}), // index.html should be in root of project
livereload({ watch:'src', delay:1000, exts: [ 'html', 'js', 'scss', 'css' ] }),
cleanup(),
nodeResolve(),
commonjs()
]
},
]