-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
41 lines (40 loc) · 1.1 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import typescript from "rollup-plugin-typescript2";
import del from "rollup-plugin-delete";
import pkg from "./package.json";
import { eslint } from "rollup-plugin-eslint";
import replace from "@rollup/plugin-replace";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
const EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".json"];
const external = ["react", "react-dom"];
const globals = {
react: "React",
"react-dom": "ReactDOM",
};
const NODE_ENV = process.env.NODE_ENV || "development";
export default [
{
input: "src/romaine_components.development.tsx",
output: {
esModule: false,
name: "romaine",
file: pkg.main,
format: "esm",
sourcemap: true,
globals,
exports: "named",
// paths: {
// react: "../../node_modules/react",
// },
},
plugins: [
// del({ targets: ["dist/*", "playground/src/component-lib"] }),
typescript({ tsconfig: "./tsconfig.json" }),
replace({
"process.env.NODE_ENV": JSON.stringify(NODE_ENV),
}),
peerDepsExternal(),
eslint(),
],
external,
},
];