-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathrollup.config.js
More file actions
38 lines (35 loc) · 1.07 KB
/
rollup.config.js
File metadata and controls
38 lines (35 loc) · 1.07 KB
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
import babel from "@rollup/plugin-babel";
import postcss from "rollup-plugin-postcss";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import external from "rollup-plugin-peer-deps-external";
import path from "path";
// tslint:disable-next-line: no-var-requires
import pkg from "./package.json";
const extensions = [".js", ".jsx", ".ts", ".tsx"];
export default {
input: `src/index.ts`,
output: [
// { dir: "dist/umd", name: "named", format: "umd", sourcemap: true },
{ file: pkg.main, name: "named", format: "umd", sourcemap: true },
// { dir: "dist/es", name: "named", format: "es", sourcemap: true }
{ file: pkg.module, name: "named", format: "es", sourcemap: true },
],
// tslint:disable-next-line: object-literal-sort-keys
external: [],
watch: {
include: "src/**",
},
plugins: [
external(),
postcss({
modules: false,
}),
nodeResolve({ extensions }),
// Allow json resolution
babel({
exclude: "node_modules/**",
extensions,
configFile: path.resolve(__dirname, ".babelrc.json"),
}),
],
};