1
0
Fork 0
freesewing/packages/rendertest/rollup.config.js

60 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-05-06 17:02:59 +02:00
import babel from "rollup-plugin-babel";
import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
import json from "rollup-plugin-json";
import minify from "rollup-plugin-babel-minify";
2019-07-19 15:09:05 +02:00
//import yaml from "rollup-plugin-yaml";
//import url from "rollup-plugin-url";
//import postcss from "rollup-plugin-postcss";
//import svgr from "@svgr/rollup";
2019-05-06 17:02:59 +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-05-06 17:02:59 +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-05-06 17:02:59 +02:00
export default {
input: "src/index.js",
2019-05-31 18:20:29 +02:00
output,
2019-05-06 17:02:59 +02:00
plugins: [
peerDepsExternal(),
resolve({ modulesOnly: true }),
2019-07-19 15:09:05 +02:00
//url(),
2019-05-06 17:02:59 +02:00
commonjs(),
json(),
2019-07-19 15:09:05 +02:00
//yaml(),
//svgr(),
//postcss({
// modules: true
//}),
2019-05-06 17:02:59 +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 */`
})
]
};