1 | import babel from 'rollup-plugin-babel'
|
2 | import resolve from 'rollup-plugin-node-resolve'
|
3 | import uglify from 'rollup-plugin-uglify'
|
4 |
|
5 | import {
|
6 | name,
|
7 | description,
|
8 | version,
|
9 | author,
|
10 | repository,
|
11 | license,
|
12 | main as mainPath
|
13 | } from './package.json'
|
14 |
|
15 | const banner = `/*
|
16 | * ${name} v${version}
|
17 | * ${description}
|
18 | * Copyright ${new Date().getFullYear()} ${author.name}
|
19 | * https://github.com/${repository}
|
20 | * ${license} License
|
21 | */`
|
22 |
|
23 | const plugins = [
|
24 | resolve(),
|
25 | babel({
|
26 | plugins: ['transform-custom-element-classes']
|
27 | })
|
28 | ]
|
29 |
|
30 | export 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 | }))
|