2019-05-02 12:40:03 +02:00
|
|
|
import babel from "rollup-plugin-babel";
|
|
|
|
import commonjs from "rollup-plugin-commonjs";
|
|
|
|
import external from "rollup-plugin-peer-deps-external";
|
|
|
|
import postcss from "rollup-plugin-postcss";
|
2019-04-12 19:36:32 +02:00
|
|
|
import json from "rollup-plugin-json";
|
2019-05-02 12:40:03 +02:00
|
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
|
|
import url from "rollup-plugin-url";
|
|
|
|
import svgr from "@svgr/rollup";
|
2019-04-12 19:36:32 +02:00
|
|
|
import minify from "rollup-plugin-babel-minify";
|
|
|
|
import { name, version, description, author, license } from "./package.json";
|
2018-03-04 15:43:18 -05:00
|
|
|
|
2019-05-02 12:40:03 +02:00
|
|
|
import pkg from "./package.json";
|
2018-03-04 15:43:18 -05:00
|
|
|
|
|
|
|
export default {
|
2019-05-02 12:40:03 +02:00
|
|
|
input: "src/index.js",
|
2018-03-04 15:43:18 -05:00
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: pkg.main,
|
2019-05-02 12:40:03 +02:00
|
|
|
format: "cjs",
|
2018-07-06 15:49:56 -04:00
|
|
|
sourcemap: true
|
2018-03-04 15:43:18 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
file: pkg.module,
|
2019-05-02 12:40:03 +02:00
|
|
|
format: "es",
|
2018-07-06 15:49:56 -04:00
|
|
|
sourcemap: true
|
2018-03-04 15:43:18 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
external(),
|
|
|
|
postcss({
|
|
|
|
modules: true
|
|
|
|
}),
|
2019-05-02 12:40:03 +02:00
|
|
|
url({ exclude: ["**/*.svg"] }),
|
2018-10-04 04:42:28 -04:00
|
|
|
svgr(),
|
2018-03-04 15:43:18 -05:00
|
|
|
babel({
|
2019-05-03 12:26:59 +02:00
|
|
|
exclude: "node_modules/**"
|
2018-03-04 15:43:18 -05:00
|
|
|
}),
|
2019-04-12 19:36:32 +02:00
|
|
|
resolve({ browser: true }),
|
|
|
|
json(),
|
2019-05-10 13:14:31 +02:00
|
|
|
commonjs(),
|
|
|
|
minify({
|
|
|
|
comments: false,
|
|
|
|
sourceMap: true,
|
|
|
|
banner: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
|
|
})
|
2018-03-04 15:43:18 -05:00
|
|
|
]
|
2019-05-02 12:40:03 +02:00
|
|
|
};
|