2018-08-05 11:56:55 +02:00
|
|
|
import { terser } from "rollup-plugin-terser";
|
|
|
|
import babel from "rollup-plugin-babel";
|
|
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
|
|
import json from "rollup-plugin-json";
|
2019-01-05 16:50:23 +01:00
|
|
|
import sass from "rollup-plugin-sass";
|
2019-04-20 19:23:22 +02:00
|
|
|
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
2018-08-09 11:38:19 +02:00
|
|
|
import { version, name, description, author, license } from "./package.json";
|
2019-01-05 16:50:23 +01:00
|
|
|
import fs from "fs";
|
2018-08-05 11:56:55 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
input: "src/index.js",
|
|
|
|
plugins: [
|
2019-04-20 19:23:22 +02:00
|
|
|
peerDepsExternal(),
|
|
|
|
resolve(),
|
2018-08-05 11:56:55 +02:00
|
|
|
json(),
|
|
|
|
babel({
|
|
|
|
exclude: "node_modules/**"
|
2018-09-26 12:17:10 +00:00
|
|
|
}),
|
2019-01-05 16:50:23 +01:00
|
|
|
sass({
|
|
|
|
output(styles, styleNodes) {
|
|
|
|
fs.writeFileSync(
|
|
|
|
"./src/bundle.css.js",
|
|
|
|
"export default `" + styles + "`;"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}),
|
2018-09-26 12:17:10 +00:00
|
|
|
terser({
|
|
|
|
output: {
|
|
|
|
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
|
|
}
|
2018-08-05 11:56:55 +02:00
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|