-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
32 lines (29 loc) · 1.05 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
import resolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
// import typescript from "rollup-plugin-typescript"; // remove comment once we support TS types
import { terser } from "rollup-plugin-terser";
import analyze from "rollup-plugin-analyzer";
import pkg from "./package.json";
const plugins = [
// typescript(), // remove comment once we support TS types
resolve(), // so Rollup can find deps
commonjs({ extensions: [".js", ".ts", ".tsx"] }), // so Rollup can convert deps to an ES module
terser({ exclude: "node_modules/**" }),
analyze({ summaryOnly: true }),
];
export default [
// CommonJS (for Node), ES module (for bundlers), UMD for (for browsers) build.
{
input: "src/index.js",
output: [
{ file: pkg.module, format: "es" },
{ file: pkg.main, format: "cjs" },
{
name: "styled-variants",
file: pkg.browser, // Doesnt exist yet?
format: "umd",
},
],
plugins,
},
];