2020-11-26 03:19:51 +03:00
|
|
|
import babel from "@rollup/plugin-babel";
|
|
|
|
import commonjs from "@rollup/plugin-commonjs";
|
2020-07-02 09:38:39 +03:00
|
|
|
import resolve from "@rollup/plugin-node-resolve";
|
2020-07-07 11:35:08 +03:00
|
|
|
import json from "@rollup/plugin-json";
|
2020-11-26 04:41:19 +03:00
|
|
|
import visualizer from "rollup-plugin-visualizer";
|
2020-07-02 09:38:39 +03:00
|
|
|
|
2020-11-26 02:19:02 +03:00
|
|
|
import { terser } from "rollup-plugin-terser";
|
|
|
|
|
2020-07-02 09:38:39 +03:00
|
|
|
const input = "./components/system/index.js";
|
|
|
|
|
2020-07-02 11:10:13 +03:00
|
|
|
const generateOutput = (outputPath) => {
|
|
|
|
return {
|
2020-07-02 09:38:39 +03:00
|
|
|
input,
|
|
|
|
output: {
|
2020-07-02 11:10:13 +03:00
|
|
|
file: outputPath,
|
2020-07-02 09:38:39 +03:00
|
|
|
format: "cjs",
|
|
|
|
},
|
2020-11-26 02:53:25 +03:00
|
|
|
external: ["react", "react-dom", "node-fetch"],
|
2020-07-02 09:38:39 +03:00
|
|
|
plugins: [
|
2020-07-07 11:35:08 +03:00
|
|
|
json({ exclude: ["node_modules/**"], compact: true }),
|
2020-07-02 09:38:39 +03:00
|
|
|
babel({
|
2020-07-07 11:35:08 +03:00
|
|
|
exclude: ["node_modules/**", "**/*.json"],
|
2020-11-26 03:19:51 +03:00
|
|
|
babelHelpers: "runtime",
|
2020-07-02 09:38:39 +03:00
|
|
|
}),
|
2020-11-26 04:41:19 +03:00
|
|
|
resolve({
|
|
|
|
preferBuiltins: false,
|
|
|
|
}),
|
2020-11-26 03:19:51 +03:00
|
|
|
commonjs(),
|
2020-11-26 04:41:19 +03:00
|
|
|
terser({
|
|
|
|
format: {
|
|
|
|
comments: false,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
visualizer(),
|
2020-07-02 09:38:39 +03:00
|
|
|
],
|
2020-07-02 11:10:13 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-11-04 21:00:15 +03:00
|
|
|
export default [
|
|
|
|
generateOutput("dist/index.js"),
|
|
|
|
generateOutput("../slate-react-system/src/index.js"),
|
|
|
|
];
|