UNPKG

910 BJavaScriptView Raw
1import babel from 'rollup-plugin-babel'
2import resolve from 'rollup-plugin-node-resolve'
3import uglify from 'rollup-plugin-uglify'
4
5import {
6 name,
7 description,
8 version,
9 author,
10 repository,
11 license,
12 main as mainPath
13} from './package.json'
14
15const banner = `/*
16 * ${name} v${version}
17 * ${description}
18 * Copyright ${new Date().getFullYear()} ${author.name}
19 * https://github.com/${repository}
20 * ${license} License
21 */`
22
23const plugins = [
24 resolve(),
25 babel({
26 plugins: ['transform-custom-element-classes']
27 })
28]
29
30export default [
31 {
32 file: mainPath.replace('.min', ''),
33 plugins
34 },
35 {
36 file: mainPath,
37 plugins: [
38 ...plugins,
39 uglify({
40 output: {
41 preamble: banner
42 }
43 })
44 ]
45 }
46].map(({ file, plugins }) => ({
47 input: 'index.js',
48 output: {
49 file,
50 format: 'umd',
51 name: 'MediumZoomElement'
52 },
53 banner,
54 plugins
55}))