2019-04-13 15:20:51 +02:00
|
|
|
import babel from "rollup-plugin-babel";
|
|
|
|
import resolve from "rollup-plugin-node-resolve";
|
2019-04-29 09:01:51 +02:00
|
|
|
import commonjs from "rollup-plugin-commonjs";
|
2019-04-13 15:20:51 +02:00
|
|
|
import json from "rollup-plugin-json";
|
|
|
|
import minify from "rollup-plugin-babel-minify";
|
2019-04-20 19:50:37 +02:00
|
|
|
import yaml from "rollup-plugin-yaml";
|
2019-04-29 09:01:51 +02:00
|
|
|
import url from "rollup-plugin-url";
|
|
|
|
import postcss from "rollup-plugin-postcss";
|
|
|
|
import svgr from "@svgr/rollup";
|
2019-04-19 17:31:44 +02:00
|
|
|
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
2019-05-18 17:23:05 +02:00
|
|
|
import {
|
|
|
|
name,
|
|
|
|
version,
|
|
|
|
description,
|
|
|
|
author,
|
|
|
|
license,
|
|
|
|
main,
|
|
|
|
module
|
|
|
|
} from "./package.json";
|
2019-04-13 15:20:51 +02:00
|
|
|
|
2019-05-31 18:20:29 +02:00
|
|
|
const output = [
|
|
|
|
{
|
|
|
|
file: main,
|
|
|
|
format: "cjs",
|
|
|
|
sourcemap: true
|
|
|
|
}
|
|
|
|
];
|
|
|
|
if (typeof module !== "undefined")
|
|
|
|
output.push({
|
|
|
|
file: module,
|
|
|
|
format: "es",
|
|
|
|
sourcemap: true
|
|
|
|
});
|
|
|
|
|
2019-04-13 15:20:51 +02:00
|
|
|
export default {
|
|
|
|
input: "src/index.js",
|
2019-05-31 18:20:29 +02:00
|
|
|
output,
|
2019-04-13 15:20:51 +02:00
|
|
|
plugins: [
|
2019-04-19 17:31:44 +02:00
|
|
|
peerDepsExternal(),
|
2019-04-20 19:23:22 +02:00
|
|
|
resolve({ modulesOnly: true }),
|
2019-04-29 09:01:51 +02:00
|
|
|
url(),
|
|
|
|
commonjs(),
|
2019-04-13 15:20:51 +02:00
|
|
|
json(),
|
2019-04-20 19:50:37 +02:00
|
|
|
yaml(),
|
2019-04-29 09:01:51 +02:00
|
|
|
svgr(),
|
|
|
|
postcss({
|
|
|
|
modules: true
|
|
|
|
}),
|
2019-04-13 15:20:51 +02:00
|
|
|
babel({
|
|
|
|
exclude: "node_modules/**",
|
|
|
|
plugins: ["@babel/plugin-proposal-object-rest-spread"]
|
|
|
|
}),
|
|
|
|
minify({
|
|
|
|
comments: false,
|
|
|
|
sourceMap: true,
|
|
|
|
banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|