blob: c671779c0daf13c7925cde82b3a3552ac16ec258 [file] [log] [blame]
Ted Humphrey01e5fde2020-01-27 18:57:39 -05001import babel from 'rollup-plugin-babel'
2import commonjs from '@rollup/plugin-commonjs'
3import postcss from 'rollup-plugin-postcss'
4import resolve from '@rollup/plugin-node-resolve'
5import external from 'rollup-plugin-peer-deps-external'
6import img from '@rollup/plugin-image'
7
8import pkg from './package.json'
9
10export default {
11 input: './libIndex.js',
12 output: [
13 {
14 file: pkg.main,
15 format: 'cjs',
16 sourcemap: true
17 },
18 {
19 file: pkg.module,
20 format: 'es',
21 sourcemap: true
22 }
23 ],
24 plugins: [
25 img(),
26 external(),
27 postcss({
28 modules: true
29 }),
30 babel({
31 exclude: 'node_modules/**',
32 presets: [
33
34 "@babel/preset-env", {},
35 "@babel/preset-react", {}
36 ],
37 plugins: [
38 [
39 "@babel/plugin-proposal-class-properties",
40 {
41 "loose": true
42 }
43 ]
44 ]
45 }),
46 resolve({ preferBuiltins: true, mainFields: ['browser'] })
47 ]
48}